asyncqlio.backends.sqlite3

SQLite3 backends.

sqlite3

Classes

Sqlite3Dialect The dialect for SQLite3.
class asyncqlio.backends.sqlite3.Sqlite3Dialect[source]

Bases: asyncqlio.backends.base.BaseDialect

The dialect for SQLite3.

has_checkpoints

Returns True if this dialect can use transaction checkpoints.

has_serial

Returns True if this dialect can use the SERIAL datatype.

lastval_method

The last value method for a dialect. For example, in PostgreSQL this is LASTVAL();

has_returns

Returns True if this dialect has RETURNS.

has_ilike

Returns True if this dialect has ILIKE.

has_default

Returns True if this dialect has DEFAULT.

has_truncate

Returns TRUE if this dialect has TRUNCATE.

has_cascade

Returns True if this dialect has DROP TABLE … CASCADE.

get_primary_key_index_name(table_name)[source]

Get the name a dialect gives to a table’s primary key index.

get_unique_column_index_name(table_name, column_name)[source]

Get the name a dialect gives to a unique column index.

Parameters:
  • table_name – The name of the table to use.
  • column_name – The name of the column to use.
get_column_sql(table_name=None, *, emitter)[source]

Get a query to find information on all columns, optionally limiting by table.

Parameters:
  • table_name – The name of the table to use.
  • emitter – The emitter to use.
get_index_sql(table_name=None, *, emitter)[source]

Get a query to find information on all indexes, optionally limiting by table.

Parameters:
  • table_name – The name of the table to use.
  • emitter – The emitter to use.
get_upsert_sql(table_name, *, on_conflict_update=True)[source]

Get a formattable query and a set of required params to execute upsert-like functionality.

Parameters:
  • table_name – The name of the table to upsert into.
  • on_conflict_update – If this is to update on conflict.
transform_rows_to_indexes(*rows, table_name)[source]

Transform appropriate database rows to Index objects.

Parameters:rows – A list of DictRow objects returned from the database.
transform_columns_to_indexes(*rows, table_name)

Transform appropriate database rows to Column objects.

Parameters:
  • rows (DictRow) – A list of DictRow objects returned from the database.
  • table_name (str) – The name of the table being transformed.