Database

This CDP domain is experimental.

Types

Generally, you do not need to instantiate CDP types yourself. Instead, the API creates objects for you as return values from commands, and then you can use those objects as arguments to other commands.

class cdp.database.DatabaseId

Unique identifier of Database object.

class cdp.database.Database(id_, domain, name, version)

Database object.

domain = None

Database domain.

id_ = None

Database ID.

name = None

Database name.

version = None

Database version.

class cdp.database.Error(message, code)

Database error.

code = None

Error code.

message = None

Error message.

Commands

Each command is a generator function. The return type Generator[x, y, z] indicates that the generator yields arguments of type x, it must be resumed with an argument of type y, and it returns type z. In this library, types x and y are the same for all commands, and z is the return type you should pay attention to. For more information, see Getting Started: Commands.

cdp.database.disable()

Disables database tracking, prevents database events from being sent to the client.

Return type:Generator[Dict[str, Any], Dict[str, Any], None]
cdp.database.enable()

Enables database tracking, database events will now be delivered to the client.

Return type:Generator[Dict[str, Any], Dict[str, Any], None]
cdp.database.execute_sql(database_id, query)
Parameters:
Return type:

Generator[Dict[str, Any], Dict[str, Any], Tuple[Optional[List[str]], Optional[List[Any]], Optional[Error]]]

Returns:

A tuple with the following items:

  1. columnNames -
  2. values -
  3. sqlError -

cdp.database.get_database_table_names(database_id)
Parameters:database_id (DatabaseId) –
Return type:Generator[Dict[str, Any], Dict[str, Any], List[str]]
Returns:

Events

Generally, you do not need to instantiate CDP events yourself. Instead, the API creates events for you and then you use the event’s attributes.

class cdp.database.AddDatabase(database)