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 Dialect that 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 Dialect that 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_name was 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_dbapi()

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 TypeEngine object, given the generic object which comes from the types module.

validate_identifier(ident)

Attributes

CACHE_HIT

CACHE_MISS

CACHING_DISABLED

NO_CACHE_KEY

NO_DIALECT_SUPPORT

bind_typing

define a means of passing typing information to the database and/or driver for bound parameters.

colspecs

A dictionary of TypeEngine classes from sqlalchemy.types mapped to subclasses that are specific to the dialect class.

connection_characteristics

construct_arguments

Optional set of argument specifiers for various SQLAlchemy constructs, typically schema items.

cte_follows_insert

target database, when given a CTE with an INSERT statement, needs the CTE to be below the INSERT

dbapi_exception_translation_map

A 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_token

for INSERT.

default_paramstyle

default_schema_name

the name of the default schema.

default_sequence_base

the default value that will be rendered as the "START WITH" portion of a CREATE SEQUENCE DDL statement.

delete_executemany_returning

dialect supports DELETE..RETURNING with executemany.

delete_returning

if the dialect supports RETURNING with DELETE

delete_returning_multifrom

if the dialect supports RETURNING with DELETE..FROM

dialect_description

dispatch

div_is_floordiv

target database treats the / division operator as "floor division"

driver

identifying name for the dialect's DBAPI

engine_config_types

a mapping of string keys that can be in an engine config linked to type conversion functions.

exclude_set_input_sizes

set of DBAPI type objects that should be excluded in automatic cursor.setinputsizes() calls.

favor_returning_over_lastrowid

for backends that support both a lastrowid and a RETURNING insert strategy, favor RETURNING for simple single-int pk inserts.

full_returning

has_terminate

Whether or not this dialect has a separate "terminate" implementation that does not block or require awaiting.

include_set_input_sizes

set of DBAPI type objects that should be included in automatic cursor.setinputsizes() calls.

inline_comments

Indicates the dialect supports comment DDL that's inline with the definition of a Table or Column.

insert_executemany_returning

dialect / driver / database supports some means of providing INSERT...RETURNING support when dialect.do_executemany() is used.

insert_executemany_returning_sort_by_parameter_order

dialect / 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_autoincrements

insert_returning

if the dialect supports RETURNING with INSERT

insertmanyvalues_implicit_sentinel

Options 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_parameters

Alternate to insertmanyvalues_page_size, will additionally limit page size based on number of parameters total in the statement.

insertmanyvalues_page_size

Number of rows to render into an individual INSERT..VALUES() statement for ExecuteStyle.INSERTMANYVALUES executions.

is_async

Whether or not this dialect is intended for asyncio use.

is_mariadb

ischema_names

isolation_level

loaded_dbapi

logger

max_constraint_name_length

max_identifier_length

The maximum length of identifier names.

max_index_name_length

name

identifying name for the dialect from a DBAPI-neutral point of view (i.e. 'sqlite').

non_native_boolean_check_constraint

postfetch_lastrowid

preexecute_autoincrement_sequences

True if 'implicit' primary key functions must be executed separately in order to get their value, if RETURNING is not used.

reflection_options

Sequence of string names indicating keyword arguments that can be established on a Table object which will be passed as "reflection options" when using `.Table.autoload_with`.

requires_name_normalize

returns_native_bytes

indicates if Python bytes() objects are returned natively by the driver for SQL "binary" datatypes.

sequences_optional

If True, indicates if the `_schema.Sequence.optional` parameter on the _schema.Sequence construct 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_cursors

deprecated; indicates if the dialect should attempt to use server side cursors by default

server_version_info

a tuple containing a version number for the DB backend in use.

supports_alter

True if the database supports ALTER TABLE - used only for generating foreign key constraints in certain circumstances

supports_comments

Indicates the dialect supports comment DDL on tables and columns.

supports_constraint_comments

Indicates if the dialect supports comment DDL on constraints.

supports_default_metavalue

dialect supports INSERT.

supports_default_values

dialect supports INSERT.

supports_empty_insert

dialect supports INSERT () VALUES ()

supports_for_update_of

supports_identity_columns

target database supports IDENTITY

supports_is_distinct_from

supports_multivalues_insert

Target database supports INSERT...VALUES with multiple value sets, i.e. INSERT INTO table (cols) VALUES (...), (...), (...), .

supports_native_boolean

Indicates if the dialect supports a native boolean construct.

supports_native_decimal

indicates if Decimal objects are handled and returned for precision numeric types, or if floats are returned

supports_native_enum

Indicates if the dialect supports a native ENUM construct.

supports_native_uuid

indicates if Python UUID() objects are handled natively by the driver for SQL UUID datatypes.

supports_sane_multi_rowcount

Indicate whether the dialect properly implements rowcount for UPDATE and DELETE statements when executed via executemany.

supports_sane_rowcount

Indicate whether the dialect properly implements rowcount for UPDATE and DELETE statements.

supports_sane_rowcount_returning

True if this dialect supports sane rowcount even if RETURNING is in use.

supports_schemas

supports_sequences

Indicates if the dialect supports CREATE SEQUENCE or similar.

supports_server_side_cursors

indicates if the dialect supports server side cursors

supports_simple_order_by_label

target database supports ORDER BY <labelname>, where <labelname> refers to a label in the columns clause of the SELECT

supports_statement_cache

indicates if this dialect supports caching.

supports_views

tuple_in_values

target database supports tuple IN, i.e. (x, y) IN ((q, p), (r, z)).

update_executemany_returning

dialect supports UPDATE..RETURNING with executemany.

update_returning

if the dialect supports RETURNING with UPDATE

update_returning_multifrom

if the dialect supports RETURNING with UPDATE..FROM

use_insertmanyvalues

if True, indicates "insertmanyvalues" functionality should be used to allow for insert_executemany_returning behavior, if possible.

use_insertmanyvalues_wo_returning

if True, and use_insertmanyvalues is also True, INSERT statements that don't include RETURNING will also use "insertmanyvalues".

positional

True if the paramstyle for this Dialect is positional.

paramstyle

the paramstyle to be used (some DB-APIs support multiple paramstyles).

compiler_linting

type_compiler_instance

instance of a Compiled class used to compile SQL type objects

identifier_preparer

This element will refer to an instance of IdentifierPreparer once a DefaultDialect has been constructed.

default_isolation_level

the isolation that is implicitly present on new connections

label_length

optional user-defined max length for SQL labels