sqlcompyre.analysis.dialects.duckdb module

class sqlcompyre.analysis.dialects.duckdb.DuckDBDialect(*args: Any, **kwargs: Any)[source]

Bases: Dialect, DialectProtocol

Attributes:
default_schema_name
dialect_description
exclude_set_input_sizes
full_returning

Deprecated since version 2.0: full_returning is deprecated, please use insert_returning, update_returning, delete_returning

include_set_input_sizes
isolation_level
max_constraint_name_length
max_index_name_length
server_version_info
supports_sane_rowcount_returning

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

Methods

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.

denormalize_name(name)

convert the given name to a case insensitive identifier for the backend if it is an all-lowercase name.

do_begin(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(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.

execute_sequence_format

alias of tuple

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(connection)

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_connection)

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, ...)

Return information about check constraints in all tables in the given schema.

get_multi_columns(connection[, schema, ...])

Copyright 2005-2023 SQLAlchemy authors and contributors <see AUTHORS file>.

get_multi_foreign_keys(connection, schema, ...)

Return information about foreign_keys in all tables in the given schema.

get_multi_indexes(connection[, schema, ...])

Return information about indexes in in all tables in the given schema.

get_multi_pk_constraint(connection, schema, ...)

Return information about primary key constraints in all tables in the given schema.

get_multi_table_comment(connection, schema, ...)

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, ...)

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_schema_names(connection, **kw)

Return unquoted database_name.schema_name unless either contains spaces or double quotes.

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_creation_timestamps(engine, tables)

Obtain the creation timestamps from a list of tables.

get_table_names(connection[, schema])

Return unquoted database_name.schema_name unless either contains spaces or double quotes.

get_table_oid(connection, table_name[, schema])

Fetch the oid for (database.)schema.table_name.

get_table_options(connection, table_name[, ...])

Return a dictionary of options specified when table_name was created.

get_temp_table_names(connection, **kw)

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, include])

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, **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.

dbapi

ddl_compiler

execution_ctx_cls

get_deferrable

get_pool_class

get_readonly

has_type

inspector

preparer

set_deferrable

set_readonly

statement_compiler

type_compiler_cls

validate_identifier

case_insensitive_collation: str = 'NOCASE'

Case-insensitive collation to use for string comparisons.

case_sensitive_collation: str = 'BINARY'

Case-sensitive collation to use for string comparisons.

name: str = 'duckdb'

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

supports_multi_part_schemas: bool = False

Whether the database supports multi-part schemas, i.e. queries across databases.

supports_schemas: bool = False

Whether the database has a concept of schemas.

verbose_name: str = 'DuckDB'

The common name of the dialect.

views_support_notnull_columns: bool = False

Whether views have a notion of NOT NULL columns.