sqlalchemy_singlestoredb.base.SingleStoreDBDialect¶
- class sqlalchemy_singlestoredb.base.SingleStoreDBDialect(isolation_level: str | None = None, json_serializer: Callable[[...], Any] | None = None, json_deserializer: Callable[[...], Any] | None = None, **kwargs: Any)¶
 SingleStoreDB SQLAlchemy dialect.
- __init__(isolation_level: str | None = None, json_serializer: Callable[[...], Any] | None = None, json_deserializer: Callable[[...], Any] | None = None, **kwargs: Any)¶
 
Methods
__init__([isolation_level, json_serializer, ...])connect(*cargs, **cparams)Establish a connection using this dialect's DBAPI.
create_connect_args(url)Build DB-API compatible connection arguments.
create_xid()Create a random two-phase transaction ID.
dbapi()denormalize_name(name)convert the given name to a case insensitive identifier for the backend if it is an all-lowercase name.
do_begin(dbapi_connection)Provide an implementation of
connection.begin(), given a DB-API connection.do_begin_twophase(connection, xid)Begin a two phase transaction on the given connection.
do_close(dbapi_connection)Provide an implementation of
connection.close(), given a DBAPI connection.do_commit(dbapi_connection)Provide an implementation of
connection.commit(), given a DB-API connection.do_commit_twophase(connection, xid[, ...])Commit a two phase transaction on the given connection.
do_execute(cursor, statement, parameters[, ...])Provide an implementation of
cursor.execute(statement, parameters).do_execute_no_params(cursor, statement[, ...])Provide an implementation of
cursor.execute(statement).do_executemany(cursor, statement, parameters)Provide an implementation of
cursor.executemany(statement, parameters).do_ping(dbapi_connection)ping the DBAPI connection and return True if the connection is usable.
do_prepare_twophase(connection, xid)Prepare a two phase transaction on the given connection.
do_recover_twophase(connection)Recover list of uncommitted prepared two phase transaction identifiers on the given connection.
do_release_savepoint(connection, name)Release the named savepoint on a connection.
do_rollback(dbapi_connection)Provide an implementation of
connection.rollback(), given a DB-API connection.do_rollback_to_savepoint(connection, name)Rollback a connection to the named savepoint.
do_rollback_twophase(connection, xid[, ...])Rollback a two phase transaction on the given connection.
do_savepoint(connection, name)Create a savepoint with the given name.
do_set_input_sizes(cursor, list_of_tuples, ...)invoke the cursor.setinputsizes() method with appropriate arguments
do_terminate(dbapi_connection)Provide an implementation of
connection.close()that tries as much as possible to not block, given a DBAPI connection.engine_created(engine)A convenience hook called before returning the final
_engine.Engine.get_async_dialect_cls(url)Given a URL, return the
Dialectthat will be used by an async engine.get_check_constraints(connection, table_name)Return information about check constraints in
table_name.get_columns(connection, table_name[, schema])Return information about columns in
table_name.get_default_isolation_level(dbapi_conn)Given a DBAPI connection, return its isolation level, or a default isolation level if one cannot be retrieved.
get_dialect_cls(url)Given a URL, return the
Dialectthat will be used.get_dialect_pool_class(url)return a Pool class to use for a given URL
get_driver_connection(connection)Returns the connection object as returned by the external driver package.
get_foreign_keys(connection, table_name[, ...])Return information about foreign_keys in
table_name.get_indexes(connection, table_name[, schema])Return information about indexes in
table_name.get_isolation_level(dbapi_connection)Given a DBAPI connection, return its isolation level.
get_isolation_level_values(dbapi_conn)return a sequence of string isolation level names that are accepted by this dialect.
get_materialized_view_names(connection[, schema])Return a list of all materialized view names available in the database.
get_multi_check_constraints(connection, **kw)Return information about check constraints in all tables in the given
schema.get_multi_columns(connection, **kw)Return information about columns in all tables in the given
schema.get_multi_foreign_keys(connection, **kw)Return information about foreign_keys in all tables in the given
schema.get_multi_indexes(connection, **kw)Return information about indexes in in all tables in the given
schema.get_multi_pk_constraint(connection, **kw)Return information about primary key constraints in all tables in the given
schema.get_multi_table_comment(connection, **kw)Return information about the table comment in all tables in the given
schema.get_multi_table_options(connection, **kw)Return a dictionary of options specified when the tables in the given schema were created.
get_multi_unique_constraints(connection, **kw)Return information about unique constraints in all tables in the given
schema.get_pk_constraint(connection, table_name[, ...])Return information about the primary key constraint on table_name`.
get_pool_class(url)get_schema_names(connection, **kw)Return a list of all schema names available in the database.
get_sequence_names(connection[, schema])Return a list of all sequence names available in the database.
get_table_comment(connection, table_name[, ...])Return the "comment" for the table identified by
table_name.get_table_names(connection[, schema])Return a Unicode SHOW TABLES from a given schema.
get_table_options(connection, table_name[, ...])Return a dictionary of options specified when
table_namewas created.get_temp_table_names(connection[, schema])Return a list of temporary table names on the given connection, if supported by the underlying backend.
get_temp_view_names(connection[, schema])Return a list of temporary view names on the given connection, if supported by the underlying backend.
get_unique_constraints(connection, table_name)Return information about unique constraints in
table_name.get_view_definition(connection, view_name[, ...])Return plain or materialized view definition.
get_view_names(connection[, schema])Return a list of all non-materialized view names available in the database.
has_index(connection, table_name, index_name)Check the existence of a particular index name in the database.
has_schema(connection, schema_name, **kw)Check the existence of a particular schema name in the database.
has_sequence(connection, sequence_name[, schema])Check the existence of a particular sequence in the database.
has_table(connection, table_name[, schema])For internal dialect use, check the existence of a particular table or view in the database.
Import the DBAPI module that is used by this dialect.
initialize(connection)Called during strategized creation of the dialect with a connection.
is_disconnect(e, connection, cursor)Return True if the given DB-API error indicates an invalid connection
load_provisioning()set up the provision.py module for this dialect.
normalize_name(name)convert the given name to lowercase if it is detected as case insensitive.
on_connect()return a callable which sets up a newly created DBAPI connection.
on_connect_url(url)return a callable which sets up a newly created DBAPI connection.
reset_isolation_level(dbapi_conn)Given a DBAPI connection, revert its isolation to the default.
set_connection_execution_options(connection, ...)Establish execution options for a given connection.
set_engine_execution_options(engine, opts)Establish execution options for a given engine.
set_isolation_level(dbapi_connection, level)Given a DBAPI connection, set its isolation level.
type_descriptor(typeobj)Provide a database-specific
TypeEngineobject, given the generic object which comes from the types module.validate_identifier(ident)Validates an identifier name, raising an exception if invalid
Attributes
CACHE_HITCACHE_MISSCACHING_DISABLEDNO_CACHE_KEYNO_DIALECT_SUPPORTbind_typingdefine a means of passing typing information to the database and/or driver for bound parameters.
colspecsA dictionary of TypeEngine classes from sqlalchemy.types mapped to subclasses that are specific to the dialect class.
connection_characteristicsconstruct_argumentsOptional set of argument specifiers for various SQLAlchemy constructs, typically schema items.
cte_follows_inserttarget database, when given a CTE with an INSERT statement, needs the CTE to be below the INSERT
dbapi_exception_translation_mapA dictionary of names that will contain as values the names of pep-249 exceptions ("IntegrityError", "OperationalError", etc) keyed to alternate class names, to support the case where a DBAPI has exception classes that aren't named as they are referred to (e.g. IntegrityError = MyException).
default_metavalue_tokenfor INSERT.
default_paramstyledefault_schema_namethe name of the default schema.
default_sequence_basethe default value that will be rendered as the "START WITH" portion of a CREATE SEQUENCE DDL statement.
delete_executemany_returningdialect supports DELETE..RETURNING with executemany.
delete_returningif the dialect supports RETURNING with DELETE
delete_returning_multifromif the dialect supports RETURNING with DELETE..FROM
dialect_descriptiondispatchdiv_is_floordivtarget database treats the / division operator as "floor division"
driveridentifying name for the dialect's DBAPI
engine_config_typesa mapping of string keys that can be in an engine config linked to type conversion functions.
exclude_set_input_sizesset of DBAPI type objects that should be excluded in automatic cursor.setinputsizes() calls.
favor_returning_over_lastrowidfor backends that support both a lastrowid and a RETURNING insert strategy, favor RETURNING for simple single-int pk inserts.
full_returninghas_terminateWhether or not this dialect has a separate "terminate" implementation that does not block or require awaiting.
include_set_input_sizesset of DBAPI type objects that should be included in automatic cursor.setinputsizes() calls.
inline_commentsIndicates the dialect supports comment DDL that's inline with the definition of a Table or Column.
insert_executemany_returningdialect / driver / database supports some means of providing INSERT...RETURNING support when dialect.do_executemany() is used.
insert_executemany_returning_sort_by_parameter_orderdialect / driver / database supports some means of providing INSERT...RETURNING support when dialect.do_executemany() is used along with the `_dml.Insert.returning.sort_by_parameter_order` parameter being set.
insert_null_pk_still_autoincrementsinsert_returningif the dialect supports RETURNING with INSERT
insertmanyvalues_implicit_sentinelOptions indicating the database supports a form of bulk INSERT where the autoincrement integer primary key can be reliably used as an ordering for INSERTed rows.
insertmanyvalues_max_parametersAlternate to insertmanyvalues_page_size, will additionally limit page size based on number of parameters total in the statement.
insertmanyvalues_page_sizeNumber of rows to render into an individual INSERT..VALUES() statement for
ExecuteStyle.INSERTMANYVALUESexecutions.is_asyncWhether or not this dialect is intended for asyncio use.
is_mariadbischema_namesisolation_levelloaded_dbapimax_constraint_name_lengthThe maximum length of constraint names if different from
max_identifier_length.max_identifier_lengthThe maximum length of identifier names.
max_index_name_lengthThe maximum length of index names if different from
max_identifier_length.nameidentifying name for the dialect from a DBAPI-neutral point of view (i.e. 'sqlite').
non_native_boolean_check_constraintpostfetch_lastrowidpreexecute_autoincrement_sequencesTrue if 'implicit' primary key functions must be executed separately in order to get their value, if RETURNING is not used.
reflection_optionsSequence of string names indicating keyword arguments that can be established on a
Tableobject which will be passed as "reflection options" when using `.Table.autoload_with`.requires_name_normalizereturns_native_bytesindicates if Python bytes() objects are returned natively by the driver for SQL "binary" datatypes.
sequences_optionalIf True, indicates if the `_schema.Sequence.optional` parameter on the
_schema.Sequenceconstruct should signal to not generate a CREATE SEQUENCE. Applies only to dialects that support sequences. Currently used only to allow PostgreSQL SERIAL to be used on a column that specifies Sequence() for usage on other backends.server_side_cursorsdeprecated; indicates if the dialect should attempt to use server side cursors by default
server_version_infoa tuple containing a version number for the DB backend in use.
supports_alterTrueif the database supportsALTER TABLE- used only for generating foreign key constraints in certain circumstancessupports_commentsIndicates the dialect supports comment DDL on tables and columns.
supports_constraint_commentsIndicates if the dialect supports comment DDL on constraints.
supports_default_metavaluedialect supports INSERT.
supports_default_valuesdialect supports INSERT.
supports_empty_insertdialect supports INSERT () VALUES ()
supports_for_update_ofsupports_identity_columnstarget database supports IDENTITY
supports_is_distinct_fromsupports_multivalues_insertTarget database supports INSERT...VALUES with multiple value sets, i.e. INSERT INTO table (cols) VALUES (...), (...), (...), .
supports_native_bitsupports_native_booleanIndicates if the dialect supports a native boolean construct.
supports_native_decimalindicates if Decimal objects are handled and returned for precision numeric types, or if floats are returned
supports_native_enumIndicates if the dialect supports a native ENUM construct.
supports_native_uuidindicates if Python UUID() objects are handled natively by the driver for SQL UUID datatypes.
supports_sane_multi_rowcountIndicate whether the dialect properly implements rowcount for
UPDATEandDELETEstatements when executed via executemany.supports_sane_rowcountIndicate whether the dialect properly implements rowcount for
UPDATEandDELETEstatements.supports_sane_rowcount_returningTrue if this dialect supports sane rowcount even if RETURNING is in use.
supports_schemassupports_sequencesIndicates if the dialect supports CREATE SEQUENCE or similar.
supports_server_side_cursorsindicates if the dialect supports server side cursors
supports_simple_order_by_labeltarget database supports ORDER BY <labelname>, where <labelname> refers to a label in the columns clause of the SELECT
supports_statement_cacheindicates if this dialect supports caching.
supports_viewstuple_in_valuestarget database supports tuple IN, i.e. (x, y) IN ((q, p), (r, z)).
update_executemany_returningdialect supports UPDATE..RETURNING with executemany.
update_returningif the dialect supports RETURNING with UPDATE
update_returning_multifromif the dialect supports RETURNING with UPDATE..FROM
use_insertmanyvaluesif True, indicates "insertmanyvalues" functionality should be used to allow for
insert_executemany_returningbehavior, if possible.use_insertmanyvalues_wo_returningif True, and use_insertmanyvalues is also True, INSERT statements that don't include RETURNING will also use "insertmanyvalues".
identifier_preparerThis element will refer to an instance of
IdentifierPrepareronce aDefaultDialecthas been constructed.positionalTrue if the paramstyle for this Dialect is positional.
paramstylethe paramstyle to be used (some DB-APIs support multiple paramstyles).
compiler_lintingtype_compiler_instanceinstance of a
Compiledclass used to compile SQL type objectsdefault_isolation_levelthe isolation that is implicitly present on new connections
label_lengthoptional user-defined max length for SQL labels