asyncorm.database.backends package

Submodules

asyncorm.database.backends.postgres_backend module

class asyncorm.database.backends.postgres_backend.PostgresBackend(conn_data)[source]

Bases: asyncorm.database.backends.sql_base_backend.SQLBaseBackend

PostgresBackend serves as interface with the postgres database.

get_cursor(query, forward, stop)[source]

Get a new cursor.

Parameters:
  • query (dict) – Query to be constructed.
  • forward (int) – Next step in the cursor.
  • stop (int) – Last step in the cursorself.
Returns:

New Cursor

Return type:

Cursor

get_sync_connection(loop)[source]

Get the connection synchronously.

Parameters:loop – loop that will manage the coroutine.
Returns:the postgres connection
Return type:asyncpg.connection.Connection
request(query)[source]

Send a database request inside a transaction.

Parameters:query (str) – sql sentence
Returns:asyncpg Record object
Return type:asyncpg.Record
transaction_commit()[source]

Commit the transaction.

transaction_rollback()[source]

Rollback the transaction.

transaction_start()[source]

Start the transaction.

asyncorm.database.backends.sql_base_backend module

class asyncorm.database.backends.sql_base_backend.SQLBaseBackend[source]

Bases: object

SQLBaseBackend is in charge on constructing the queries using SQL syntaxself.

db__table_add_column

Module contents