class documentation

class SuiteRequirements(Requirements):

View In Hierarchy

Undocumented

Method ​_has​_mysql​_fully​_case​_sensitive Undocumented
Method ​_has​_mysql​_on​_windows Undocumented
Method ​_has​_sqlite Undocumented
Method ​_running​_on​_windows Undocumented
Method get​_isolation​_levels Return a structure of supported isolation levels for the current testing dialect.
Method get​_order​_by​_collation Undocumented
Property ad​_hoc​_engines Test environment must allow ad-hoc engine/connection creation.
Property async​_dialect dialect makes use of await_() to invoke operations on the DBAPI.
Property autocommit target dialect supports 'AUTOCOMMIT' as an isolation_level
Property autoincrement​_insert target platform generates new surrogate integer primary key values when insert() is executed, excluding the pk column.
Property autoincrement​_without​_sequence If autoincrement=True on a column does not require an explicit sequence. This should be false only for oracle.
Property binary​_comparisons target database/driver can allow BLOB/BINARY fields to be compared against a bound parameter value.
Property binary​_literals target backend supports simple binary literals, e.g. an expression like:
Property boolean​_col​_expressions Target database must support boolean expressions as columns
Property bound​_limit​_offset target database can render LIMIT and/or OFFSET using a bound parameter
Property cast​_precision​_numerics​_many​_significant​_digits same as precision_numerics_many_significant_digits but within the context of a CAST statement (hello MySQL)
Property cextensions Undocumented
Property check​_constraint​_reflection target dialect supports reflection of check constraints
Property comment​_reflection Undocumented
Property computed​_columns Supports computed columns
Property computed​_columns​_default​_persisted If the default persistence is virtual or stored when persisted is omitted
Property computed​_columns​_reflect​_persisted If persistence information is returned by the reflection of computed columns
Property computed​_columns​_stored Supports computed columns with persisted=True
Property computed​_columns​_virtual Supports computed columns with persisted=False
Property cpython Undocumented
Property create​_table target platform can emit basic CreateTable DDL.
Property cross​_schema​_fk​_reflection target system must support reflection of inter-schema foreign keys
Property ctes Target database supports CTEs
Property ctes​_on​_dml target database supports CTES which consist of INSERT, UPDATE or DELETE within the CTE, e.g. WITH x AS (UPDATE....)
Property ctes​_with​_update​_delete target database supports CTES that ride on top of a normal UPDATE or DELETE statement which refers to the CTE in a correlated subquery.
Property dataclasses Undocumented
Property date target dialect supports representation of Python datetime.date() objects.
Property date​_coerces​_from​_datetime target dialect accepts a datetime object as the target of a date column.
Property date​_historic target dialect supports representation of Python datetime.datetime() objects with historic (pre 1970) values.
Property datetime target dialect supports representation of Python datetime.datetime() objects.
Property datetime​_historic target dialect supports representation of Python datetime.datetime() objects with historic (pre 1970) values.
Property datetime​_implicit​_bound target dialect when given a datetime object will bind it such that the database server knows the object is a datetime, and not a plain string.
Property datetime​_literals target dialect supports rendering of a date, time, or datetime as a literal string, e.g. via the TypeEngine.literal_processor() method.
Property datetime​_microseconds target dialect supports representation of Python datetime.datetime() with microsecond objects.
Property datetime​_timezone target dialect supports representation of Python datetime.datetime() with tzinfo with DateTime(timezone=True).
Property dbapi​_lastrowid target platform includes a 'lastrowid' accessor on the DBAPI cursor object.
Property default​_schema​_name​_switch target dialect implements provisioning module including set_default_schema_on_connection
Property deferrable​_fks Undocumented
Property delete​_from Target must support DELETE FROM..FROM or DELETE..USING syntax
Property denormalized​_names Target database must have 'denormalized', i.e. UPPERCASE as case insensitive names.
Property drop​_table target platform can emit basic DropTable DDL.
Property duplicate​_key​_raises​_integrity​_error target dialect raises IntegrityError when reporting an INSERT with a primary key violation. (hint: it should)
Property duplicate​_names​_in​_cursor​_description target platform supports a SELECT statement that has the same name repeated more than once in the columns list.
Property empty​_inserts target platform supports INSERT with no values, i.e. INSERT DEFAULT VALUES or equivalent.
Property empty​_inserts​_executemany target platform supports INSERT with no values, i.e. INSERT DEFAULT VALUES or equivalent, within executemany()
Property empty​_strings​_text target database can persist/return an empty string with an unbounded text.
Property empty​_strings​_varchar target database can persist/return an empty string with a varchar.
Property emulated​_lastrowid target dialect retrieves cursor.lastrowid, or fetches from a database-side function after an insert() construct executes, within the get_lastrowid() method.
Property emulated​_lastrowid​_even​_with​_sequences target dialect retrieves cursor.lastrowid or an equivalent after an insert() construct executes, even if the table has a Sequence on it.
Property except​_ Target database must support EXCEPT or equivalent (i.e. MINUS).
Property expressions​_against​_unbounded​_text target database supports use of an unbounded textual field in a WHERE clause.
Property fetch​_expression backend supports fetch / offset with expression in them, like
Property fetch​_first backend supports the fetch first clause.
Property fetch​_no​_order​_by backend supports the fetch first without order by
Property fetch​_null​_from​_numeric target backend doesn't crash when you try to select a NUMERIC value that has a value of NULL.
Property fetch​_offset​_with​_options backend supports the offset when using fetch first with percent or ties. basically this is "not mssql"
Property fetch​_percent backend supports the fetch first clause with percent.
Property fetch​_rows​_post​_commit target platform will allow cursor.fetchone() to proceed after a COMMIT.
Property fetch​_ties backend supports the fetch first clause with ties.
Property fk​_constraint​_option​_reflection​_ondelete​_noaction Undocumented
Property fk​_constraint​_option​_reflection​_ondelete​_restrict Undocumented
Property fk​_constraint​_option​_reflection​_onupdate​_restrict Undocumented
Property floats​_to​_four​_decimals target backend can return a floating-point number with four significant digits (such as 15.7563) accurately (i.e. without FP inaccuracies, such as 15.75629997253418).
Property foreign​_key​_constraint​_name​_reflection Target supports refleciton of FOREIGN KEY constraints and will return the name of the constraint that was used in the "CONSTRAINT <name> FOREIGN KEY" DDL.
Property foreign​_key​_constraint​_option​_reflection​_ondelete Undocumented
Property foreign​_key​_constraint​_option​_reflection​_onupdate Undocumented
Property foreign​_key​_constraint​_reflection Undocumented
Property foreign​_key​_ddl Target database must support the DDL phrases for FOREIGN KEY.
Property foreign​_keys Target database must support foreign keys.
Property full​_returning target platform supports RETURNING completely, including multiple rows returned.
Property generic​_classes If X[Y] can be implemented with __class_getitem__. py3.7+
Property graceful​_disconnects Target driver must raise a DBAPI-level exception, such as InterfaceError, when the underlying connection has been closed and the execute() method is called.
Property greenlet Undocumented
Property group​_by​_complex​_expression target platform supports SQL expressions in GROUP BY
Property identity​_columns If a backend supports GENERATED { ALWAYS | BY DEFAULT } AS IDENTITY
Property identity​_columns​_standard If a backend supports GENERATED { ALWAYS | BY DEFAULT } AS IDENTITY with a standard syntax. This is mainly to exclude MSSql.
Property implements​_get​_lastrowid target dialect implements the executioncontext.get_lastrowid() method without reliance on RETURNING.
Property implicit​_decimal​_binds target backend will return a selected Decimal as a Decimal, not a string.
Property implicit​_default​_schema target system has a strong concept of 'default' schema that can be referred to implicitly.
Property implicitly​_named​_constraints target database must apply names to unnamed constraints.
Property independent​_connections Target must support simultaneous, independent database connections.
Property index​_ddl​_if​_exists target platform supports IF NOT EXISTS / IF EXISTS for indexes.
Property index​_reflection Undocumented
Property index​_reflects​_included​_columns Undocumented
Property indexes​_with​_ascdesc target database supports CREATE INDEX with per-column ASC/DESC.
Property indexes​_with​_expressions target database supports CREATE INDEX against SQL expressions.
Property infinity​_floats The Float type can persist and load float('inf'), float('-inf').
Property insert​_executemany​_returning target platform supports RETURNING when INSERT is used with executemany(), e.g. multiple parameter sets, indicating as many rows come back as do parameter sets were passed.
Property insert​_from​_select target platform supports INSERT from a SELECT.
Property insert​_order​_dicts Undocumented
Property intersect Target database must support INTERSECT or equivalent.
Property isolation​_level target dialect supports general isolation level settings.
Property json​_array​_indexes target platform supports numeric array indexes within a JSON structure
Property json​_index​_supplementary​_unicode​_element Undocumented
Property json​_type target platform implements a native JSON type.
Property legacy​_unconditional​_json​_extract Backend has a JSON_EXTRACT or similar function that returns a valid JSON string in all cases.
Property memory​_intensive Undocumented
Property mod​_operator​_as​_percent​_sign target database must use a plain percent '%' as the 'modulus' operator.
Property multivalues​_inserts target database must support multiple VALUES clauses in an INSERT statement.
Property named​_constraints target database must support names for constraints.
Property nested​_aggregates target database can select an aggregate from a subquery that's also using an aggregate
Property no​_coverage Test should be skipped if coverage is enabled.
Property no​_lastrowid​_support the opposite of supports_lastrowid
Property no​_sequences the opposite of "sequences", DB does not support sequences at all.
Property no​_windows Undocumented
Property non​_broken​_pickle Undocumented
Property non​_updating​_cascade target database must not support ON UPDATE..CASCADE behavior in foreign keys.
Property nullable​_booleans Target database allows boolean columns to store NULL.
Property nullsordering Target backends that support nulls ordering.
Property offset target database can render OFFSET, or an equivalent, in a SELECT.
Property on​_update​_cascade target database must support ON UPDATE..CASCADE behavior in foreign keys.
Property on​_update​_or​_deferrable​_fks Undocumented
Property order​_by​_col​_from​_union target database supports ordering by a column from a SELECT inside of a UNION
Property order​_by​_collation Undocumented
Property order​_by​_label​_with​_expression target backend supports ORDER BY a column label within an expression.
Property parens​_in​_union​_contained​_select​_w​_limit​_offset Target database must support parenthesized SELECT in UNION when LIMIT/OFFSET is specifically present.
Property parens​_in​_union​_contained​_select​_wo​_limit​_offset Target database must support parenthesized SELECT in UNION when OFFSET/LIMIT is specifically not present.
Property patch​_library Undocumented
Property pep520 Undocumented
Property percent​_schema​_names target backend supports weird identifiers with percent signs in them, e.g. 'some % column'.
Property precision​_generic​_float​_type target backend will return native floating point numbers with at least seven decimal places when using the generic Float type.
Property precision​_numerics​_enotation​_large target backend supports Decimal() objects using E notation to represent very large values.
Property precision​_numerics​_enotation​_small target backend supports Decimal() objects using E notation to represent very small values.
Property precision​_numerics​_general target backend has general support for moderately high-precision numerics.
Property precision​_numerics​_many​_significant​_digits target backend supports values with many digits on both sides, such as 319438950232418390.273596, 87673.594069654243
Property precision​_numerics​_retains​_significant​_digits A precision numeric type will return empty significant digits, i.e. a value such as 10.000 will come back in Decimal form with the .000 maintained.
Property predictable​_gc target platform must remove all cycles unconditionally when gc.collect() is called, as well as clean out unreferenced subclasses.
Property primary​_key​_constraint​_reflection Undocumented
Property python2 Undocumented
Property python3 Undocumented
Property python36 Undocumented
Property python37 Undocumented
Property python38 Undocumented
Property queue​_pool target database is using QueuePool
Property recursive​_fk​_cascade target database must support ON DELETE CASCADE on a self-referential foreign key
Property reflect​_tables​_no​_columns target database supports creation and reflection of tables with no columns, or at least tables that seem to have no columns.
Property reflects​_pk​_names Undocumented
Property regexp​_match backend supports the regexp_match operator.
Property regexp​_replace backend supports the regexp_replace operator.
Property returning target platform supports RETURNING for at least one row.
Property sane​_multi​_rowcount Undocumented
Property sane​_rowcount Undocumented
Property sane​_rowcount​_w​_returning Undocumented
Property savepoints Target database must support savepoints.
Property schema​_reflection Undocumented
Property schemas Target database must support external schemas, and have one named 'test_schema'.
Property selectone target driver must support the literal statement 'select 1'
Property self​_referential​_foreign​_keys Target database must support self-referential foreign keys.
Property sequences Target database must support SEQUENCEs.
Property sequences​_optional Target database supports sequences, but also optionally as a means of generating new PK values.
Property server​_side​_cursors Target dialect must support server side cursors.
Property skip​_mysql​_on​_windows Catchall for a large variety of MySQL on Windows failures
Property sql​_expression​_limit​_offset target database can render LIMIT and/or OFFSET with a complete SQL expression, such as one that uses the addition operator. parameter
Property sqlalchemy2​_stubs Undocumented
Property sqlite Undocumented
Property standalone​_binds target database/driver supports bound parameters as column expressions without being in the context of a typed column.
Property standalone​_null​_binds​_whereclause target database/driver supports bound parameters with NULL in the WHERE clause, in situations where it has to be typed.
Property standard​_cursor​_sql Target database passes SQL-92 style statements to cursor.execute() when a statement like select() or insert() is run.
Property subqueries Target database must support subqueries.
Property supports​_distinct​_on If a backend supports the DISTINCT ON in a select
Property supports​_is​_distinct​_from Supports some form of "x IS [NOT] DISTINCT FROM y" construct. Different dialects will implement their own flavour, e.g., sqlite will emit "x IS NOT y" instead of "x IS DISTINCT FROM y".
Property supports​_lastrowid target database / driver supports cursor.lastrowid as a means of retrieving the last inserted primary key value.
Property symbol​_names​_w​_double​_quote Target driver can create tables with a name like 'some " table'
Property table​_ddl​_if​_exists target platform supports IF NOT EXISTS / IF EXISTS for tables.
Property table​_reflection target database has general support for table reflection
Property table​_value​_constructor Database / dialect supports a query like:
Property temp​_table​_names target dialect supports listing of temporary table names
Property temp​_table​_reflect​_indexes Undocumented
Property temp​_table​_reflection Undocumented
Property temporary​_tables target database supports temporary tables
Property temporary​_views target database supports temporary views
Property text​_type Target database must support an unbounded Text() " "type such as TEXT or CLOB
Property threading​_with​_mock Mark tests that use threading and mock at the same time - stability issues have been observed with coverage + python 3.3
Property time target dialect supports representation of Python datetime.time() objects.
Property time​_microseconds target dialect supports representation of Python datetime.time() with microsecond objects.
Property time​_timezone target dialect supports representation of Python datetime.time() with tzinfo with Time(timezone=True).
Property timestamp​_microseconds target dialect supports representation of Python datetime.datetime() with microsecond objects but only if TIMESTAMP is used.
Property timestamp​_microseconds​_implicit​_bound No summary
Property timing​_intensive Undocumented
Property tuple​_in Target platform supports the syntax "(x, y) IN ((x1, y1), (x2, y2), ...)"
Property tuple​_in​_w​_empty Target platform tuple IN w/ empty set
Property two​_phase​_transactions Target database must support two-phase transactions.
Property unbounded​_varchar Target database must support VARCHAR with no length
Property unicode​_connections Target driver must support non-ASCII characters being passed at all.
Property unicode​_data Target database/dialect must support Python unicode objects with non-ASCII characters represented, delivered as bound parameters as well as in result rows.
Property unicode​_ddl Target driver must support some degree of non-ascii symbol names.
Property unique​_constraint​_reflection target dialect supports reflection of unique constraints
Property update​_from Target must support UPDATE..FROM syntax
Property update​_where​_target​_in​_subquery Target must support UPDATE (or DELETE) where the same table is present in a subquery in the WHERE clause.
Property view​_column​_reflection target database must support retrieval of the columns in a view, similarly to how a table is inspected.
Property view​_reflection target database must support inspection of the full CREATE VIEW definition.
Property views Target database must support VIEWs.
Property window​_functions Target database must support window functions.
def _has_mysql_fully_case_sensitive(self, config):

Undocumented

def _has_mysql_on_windows(self, config):

Undocumented

def _has_sqlite(self):

Undocumented

def _running_on_windows(self):

Undocumented

def get_isolation_levels(self, config):

Return a structure of supported isolation levels for the current testing dialect.

The structure indicates to the testing suite what the expected "default" isolation should be, as well as the other values that are accepted. The dictionary has two keys, "default" and "supported". The "supported" key refers to a list of all supported levels and it should include AUTOCOMMIT if the dialect supports it.

If the .DefaultRequirements.isolation_level requirement is not open, then this method has no return value.

E.g.:

>>> testing.requirements.get_isolation_levels()
{
    "default": "READ_COMMITTED",
    "supported": [
        "SERIALIZABLE", "READ UNCOMMITTED",
        "READ COMMITTED", "REPEATABLE READ",
        "AUTOCOMMIT"
    ]
}
def get_order_by_collation(self, config):

Undocumented

@property
ad_hoc_engines =

Test environment must allow ad-hoc engine/connection creation.

DBs that scale poorly for many connections, even when closed, i.e. Oracle, may use the "--low-connections" option which flags this requirement as not present.

@property
async_dialect =
dialect makes use of await_() to invoke operations on the DBAPI.
@property
autocommit =
target dialect supports 'AUTOCOMMIT' as an isolation_level
@property
autoincrement_insert =
target platform generates new surrogate integer primary key values when insert() is executed, excluding the pk column.
@property
autoincrement_without_sequence =
If autoincrement=True on a column does not require an explicit sequence. This should be false only for oracle.
@property
binary_comparisons =
target database/driver can allow BLOB/BINARY fields to be compared against a bound parameter value.
@property
binary_literals =

target backend supports simple binary literals, e.g. an expression like:

SELECT CAST('foo' AS BINARY)

Where BINARY is the type emitted from .LargeBinary, e.g. it could be BLOB or similar.

Basically fails on Oracle.

@property
boolean_col_expressions =
Target database must support boolean expressions as columns
@property
bound_limit_offset =
target database can render LIMIT and/or OFFSET using a bound parameter
@property
cast_precision_numerics_many_significant_digits =
same as precision_numerics_many_significant_digits but within the context of a CAST statement (hello MySQL)
@property
cextensions =

Undocumented

@property
check_constraint_reflection =
target dialect supports reflection of check constraints
@property
comment_reflection =

Undocumented

@property
computed_columns =
Supports computed columns
@property
computed_columns_default_persisted =
If the default persistence is virtual or stored when persisted is omitted
@property
computed_columns_reflect_persisted =
If persistence information is returned by the reflection of computed columns
@property
computed_columns_stored =
Supports computed columns with persisted=True
@property
computed_columns_virtual =
Supports computed columns with persisted=False
@property
cpython =

Undocumented

@property
create_table =
target platform can emit basic CreateTable DDL.
@property
cross_schema_fk_reflection =
target system must support reflection of inter-schema foreign keys
@property
ctes =
Target database supports CTEs
@property
ctes_on_dml =
target database supports CTES which consist of INSERT, UPDATE or DELETE within the CTE, e.g. WITH x AS (UPDATE....)
@property
ctes_with_update_delete =
target database supports CTES that ride on top of a normal UPDATE or DELETE statement which refers to the CTE in a correlated subquery.
@property
dataclasses =

Undocumented

@property
date =
target dialect supports representation of Python datetime.date() objects.
@property
date_coerces_from_datetime =
target dialect accepts a datetime object as the target of a date column.
@property
date_historic =
target dialect supports representation of Python datetime.datetime() objects with historic (pre 1970) values.
@property
datetime =
target dialect supports representation of Python datetime.datetime() objects.
@property
datetime_historic =
target dialect supports representation of Python datetime.datetime() objects with historic (pre 1970) values.
@property
datetime_implicit_bound =
target dialect when given a datetime object will bind it such that the database server knows the object is a datetime, and not a plain string.
@property
datetime_literals =
target dialect supports rendering of a date, time, or datetime as a literal string, e.g. via the TypeEngine.literal_processor() method.
@property
datetime_microseconds =
target dialect supports representation of Python datetime.datetime() with microsecond objects.
@property
datetime_timezone =
target dialect supports representation of Python datetime.datetime() with tzinfo with DateTime(timezone=True).
@property
dbapi_lastrowid =
target platform includes a 'lastrowid' accessor on the DBAPI cursor object.
@property
default_schema_name_switch =
target dialect implements provisioning module including set_default_schema_on_connection
@property
deferrable_fks =

Undocumented

@property
delete_from =
Target must support DELETE FROM..FROM or DELETE..USING syntax
@property
denormalized_names =
Target database must have 'denormalized', i.e. UPPERCASE as case insensitive names.
@property
drop_table =
target platform can emit basic DropTable DDL.
@property
duplicate_key_raises_integrity_error =
target dialect raises IntegrityError when reporting an INSERT with a primary key violation. (hint: it should)
@property
duplicate_names_in_cursor_description =
target platform supports a SELECT statement that has the same name repeated more than once in the columns list.
@property
empty_inserts =
target platform supports INSERT with no values, i.e. INSERT DEFAULT VALUES or equivalent.
@property
empty_inserts_executemany =
target platform supports INSERT with no values, i.e. INSERT DEFAULT VALUES or equivalent, within executemany()
@property
empty_strings_text =
target database can persist/return an empty string with an unbounded text.
@property
empty_strings_varchar =
target database can persist/return an empty string with a varchar.
@property
emulated_lastrowid =

target dialect retrieves cursor.lastrowid, or fetches from a database-side function after an insert() construct executes, within the get_lastrowid() method.

Only dialects that "pre-execute", or need RETURNING to get last inserted id, would return closed/fail/skip for this.

@property
emulated_lastrowid_even_with_sequences =
target dialect retrieves cursor.lastrowid or an equivalent after an insert() construct executes, even if the table has a Sequence on it.
@property
except_ =
Target database must support EXCEPT or equivalent (i.e. MINUS).
@property
expressions_against_unbounded_text =
target database supports use of an unbounded textual field in a WHERE clause.
@property
fetch_expression =

backend supports fetch / offset with expression in them, like

SELECT * FROM some_table OFFSET 1 + 1 ROWS FETCH FIRST 1 + 1 ROWS ONLY

@property
fetch_first =
backend supports the fetch first clause.
@property
fetch_no_order_by =
backend supports the fetch first without order by
@property
fetch_null_from_numeric =

target backend doesn't crash when you try to select a NUMERIC value that has a value of NULL.

Added to support Pyodbc bug #351.

@property
fetch_offset_with_options =
backend supports the offset when using fetch first with percent or ties. basically this is "not mssql"
@property
fetch_percent =
backend supports the fetch first clause with percent.
@property
fetch_rows_post_commit =

target platform will allow cursor.fetchone() to proceed after a COMMIT.

Typically this refers to an INSERT statement with RETURNING which is invoked within "autocommit". If the row can be returned after the autocommit, then this rule can be open.

@property
fetch_ties =
backend supports the fetch first clause with ties.
@property
fk_constraint_option_reflection_ondelete_noaction =

Undocumented

@property
fk_constraint_option_reflection_ondelete_restrict =

Undocumented

@property
fk_constraint_option_reflection_onupdate_restrict =

Undocumented

@property
floats_to_four_decimals =
target backend can return a floating-point number with four significant digits (such as 15.7563) accurately (i.e. without FP inaccuracies, such as 15.75629997253418).
@property
foreign_key_constraint_name_reflection =

Target supports refleciton of FOREIGN KEY constraints and will return the name of the constraint that was used in the "CONSTRAINT <name> FOREIGN KEY" DDL.

MySQL prior to version 8 and MariaDB prior to version 10.5 don't support this.

@property
foreign_key_constraint_option_reflection_ondelete =

Undocumented

@property
foreign_key_constraint_option_reflection_onupdate =

Undocumented

@property
foreign_key_constraint_reflection =

Undocumented

@property
foreign_key_ddl =
Target database must support the DDL phrases for FOREIGN KEY.
@property
foreign_keys =
Target database must support foreign keys.
@property
full_returning =
target platform supports RETURNING completely, including multiple rows returned.
@property
generic_classes =
If X[Y] can be implemented with __class_getitem__. py3.7+
@property
graceful_disconnects =
Target driver must raise a DBAPI-level exception, such as InterfaceError, when the underlying connection has been closed and the execute() method is called.
@property
greenlet =

Undocumented

@property
group_by_complex_expression =

target platform supports SQL expressions in GROUP BY

e.g.

SELECT x + y AS somelabel FROM table GROUP BY x + y

@property
identity_columns =
If a backend supports GENERATED { ALWAYS | BY DEFAULT } AS IDENTITY
@property
identity_columns_standard =
If a backend supports GENERATED { ALWAYS | BY DEFAULT } AS IDENTITY with a standard syntax. This is mainly to exclude MSSql.
@property
implements_get_lastrowid =
target dialect implements the executioncontext.get_lastrowid() method without reliance on RETURNING.
@property
implicit_decimal_binds =

target backend will return a selected Decimal as a Decimal, not a string.

e.g.:

expr = decimal.Decimal("15.7563")

value = e.scalar(
    select(literal(expr))
)

assert value == expr

See :ticket:`4036`

@property
implicit_default_schema =

target system has a strong concept of 'default' schema that can be referred to implicitly.

basically, PostgreSQL.

@property
implicitly_named_constraints =
target database must apply names to unnamed constraints.
@property
independent_connections =
Target must support simultaneous, independent database connections.
@property
index_ddl_if_exists =
target platform supports IF NOT EXISTS / IF EXISTS for indexes.
@property
index_reflection =

Undocumented

@property
index_reflects_included_columns =

Undocumented

@property
indexes_with_ascdesc =
target database supports CREATE INDEX with per-column ASC/DESC.
@property
indexes_with_expressions =
target database supports CREATE INDEX against SQL expressions.
@property
infinity_floats =
The Float type can persist and load float('inf'), float('-inf').
@property
insert_executemany_returning =
target platform supports RETURNING when INSERT is used with executemany(), e.g. multiple parameter sets, indicating as many rows come back as do parameter sets were passed.
@property
insert_from_select =
target platform supports INSERT from a SELECT.
@property
insert_order_dicts =

Undocumented

@property
intersect =
Target database must support INTERSECT or equivalent.
@property
isolation_level =

target dialect supports general isolation level settings.

Note that this requirement, when enabled, also requires that the get_isolation_levels() method be implemented.

@property
json_array_indexes =
target platform supports numeric array indexes within a JSON structure
@property
json_index_supplementary_unicode_element =

Undocumented

@property
json_type =
target platform implements a native JSON type.
@property
legacy_unconditional_json_extract =

Backend has a JSON_EXTRACT or similar function that returns a valid JSON string in all cases.

Used to test a legacy feature and is not needed.

@property
memory_intensive =

Undocumented

@property
mod_operator_as_percent_sign =
target database must use a plain percent '%' as the 'modulus' operator.
@property
multivalues_inserts =
target database must support multiple VALUES clauses in an INSERT statement.
@property
named_constraints =
target database must support names for constraints.
@property
nested_aggregates =
target database can select an aggregate from a subquery that's also using an aggregate
@property
no_coverage =

Test should be skipped if coverage is enabled.

This is to block tests that exercise libraries that seem to be sensitive to coverage, such as PostgreSQL notice logging.

@property
no_lastrowid_support =
the opposite of supports_lastrowid
@property
no_sequences =
the opposite of "sequences", DB does not support sequences at all.
@property
no_windows =

Undocumented

@property
non_broken_pickle =

Undocumented

@property
non_updating_cascade =
target database must not support ON UPDATE..CASCADE behavior in foreign keys.
@property
nullable_booleans =
Target database allows boolean columns to store NULL.
@property
nullsordering =
Target backends that support nulls ordering.
@property
offset =
target database can render OFFSET, or an equivalent, in a SELECT.
@property
on_update_cascade =
target database must support ON UPDATE..CASCADE behavior in foreign keys.
@property
on_update_or_deferrable_fks =

Undocumented

@property
order_by_col_from_union =

target database supports ordering by a column from a SELECT inside of a UNION

E.g. (SELECT id, ...) UNION (SELECT id, ...) ORDER BY id

@property
order_by_collation =

Undocumented

@property
order_by_label_with_expression =

target backend supports ORDER BY a column label within an expression.

Basically this:

select data as foo from test order by foo || 'bar'

Lots of databases including PostgreSQL don't support this, so this is off by default.

@property
parens_in_union_contained_select_w_limit_offset =

Target database must support parenthesized SELECT in UNION when LIMIT/OFFSET is specifically present.

E.g. (SELECT ...) UNION (SELECT ..)

This is known to fail on SQLite.

@property
parens_in_union_contained_select_wo_limit_offset =

Target database must support parenthesized SELECT in UNION when OFFSET/LIMIT is specifically not present.

E.g. (SELECT ... LIMIT ..) UNION (SELECT .. OFFSET ..)

This is known to fail on SQLite. It also fails on Oracle because without LIMIT/OFFSET, there is currently no step that creates an additional subquery.

@property
patch_library =

Undocumented

@property
pep520 =

Undocumented

@property
percent_schema_names =

target backend supports weird identifiers with percent signs in them, e.g. 'some % column'.

this is a very weird use case but often has problems because of DBAPIs that use python formatting. It's not a critical use case either.

@property
precision_generic_float_type =
target backend will return native floating point numbers with at least seven decimal places when using the generic Float type.
@property
precision_numerics_enotation_large =
target backend supports Decimal() objects using E notation to represent very large values.
@property
precision_numerics_enotation_small =
target backend supports Decimal() objects using E notation to represent very small values.
@property
precision_numerics_general =
target backend has general support for moderately high-precision numerics.
@property
precision_numerics_many_significant_digits =
target backend supports values with many digits on both sides, such as 319438950232418390.273596, 87673.594069654243
@property
precision_numerics_retains_significant_digits =
A precision numeric type will return empty significant digits, i.e. a value such as 10.000 will come back in Decimal form with the .000 maintained.
@property
predictable_gc =
target platform must remove all cycles unconditionally when gc.collect() is called, as well as clean out unreferenced subclasses.
@property
primary_key_constraint_reflection =

Undocumented

@property
python2 =

Undocumented

@property
python3 =

Undocumented

@property
python36 =

Undocumented

@property
python37 =

Undocumented

@property
python38 =

Undocumented

@property
queue_pool =
target database is using QueuePool
@property
recursive_fk_cascade =
target database must support ON DELETE CASCADE on a self-referential foreign key
@property
reflect_tables_no_columns =
target database supports creation and reflection of tables with no columns, or at least tables that seem to have no columns.
@property
reflects_pk_names =

Undocumented

@property
regexp_match =
backend supports the regexp_match operator.
@property
regexp_replace =
backend supports the regexp_replace operator.
@property
returning =

target platform supports RETURNING for at least one row.

See Also

.Requirements.full_returning

@property
sane_multi_rowcount =

Undocumented

@property
sane_rowcount =

Undocumented

@property
sane_rowcount_w_returning =

Undocumented

@property
savepoints =
Target database must support savepoints.
@property
schema_reflection =

Undocumented

@property
schemas =
Target database must support external schemas, and have one named 'test_schema'.
@property
selectone =
target driver must support the literal statement 'select 1'
@property
self_referential_foreign_keys =
Target database must support self-referential foreign keys.
@property
sequences =
Target database must support SEQUENCEs.
@property
sequences_optional =
Target database supports sequences, but also optionally as a means of generating new PK values.
@property
server_side_cursors =
Target dialect must support server side cursors.
@property
skip_mysql_on_windows =
Catchall for a large variety of MySQL on Windows failures
@property
sql_expression_limit_offset =
target database can render LIMIT and/or OFFSET with a complete SQL expression, such as one that uses the addition operator. parameter
@property
sqlalchemy2_stubs =

Undocumented

@property
sqlite =

Undocumented

@property
standalone_binds =
target database/driver supports bound parameters as column expressions without being in the context of a typed column.
@property
standalone_null_binds_whereclause =
target database/driver supports bound parameters with NULL in the WHERE clause, in situations where it has to be typed.
@property
standard_cursor_sql =

Target database passes SQL-92 style statements to cursor.execute() when a statement like select() or insert() is run.

A very small portion of dialect-level tests will ensure that certain conditions are present in SQL strings, and these tests use very basic SQL that will work on any SQL-like platform in order to assert results.

It's normally a given for any pep-249 DBAPI that a statement like "SELECT id, name FROM table WHERE some_table.id=5" will work. However, there are dialects that don't actually produce SQL Strings and instead may work with symbolic objects instead, or dialects that aren't working with SQL, so for those this requirement can be marked as excluded.

@property
subqueries =
Target database must support subqueries.
@property
supports_distinct_on =
If a backend supports the DISTINCT ON in a select
@property
supports_is_distinct_from =

Supports some form of "x IS [NOT] DISTINCT FROM y" construct. Different dialects will implement their own flavour, e.g., sqlite will emit "x IS NOT y" instead of "x IS DISTINCT FROM y".

See Also

.ColumnOperators.is_distinct_from

@property
supports_lastrowid =

target database / driver supports cursor.lastrowid as a means of retrieving the last inserted primary key value.

note that if the target DB supports sequences also, this is still assumed to work. This is a new use case brought on by MariaDB 10.3.

@property
symbol_names_w_double_quote =
Target driver can create tables with a name like 'some " table'
@property
table_ddl_if_exists =
target platform supports IF NOT EXISTS / IF EXISTS for tables.
@property
table_reflection =
target database has general support for table reflection
@property
table_value_constructor =

Database / dialect supports a query like:

SELECT * FROM VALUES ( (c1, c2), (c1, c2), ...)
AS some_table(col1, col2)

SQLAlchemy generates this with the _sql.values function.

@property
temp_table_names =
target dialect supports listing of temporary table names
@property
temp_table_reflect_indexes =

Undocumented

@property
temp_table_reflection =

Undocumented

@property
temporary_tables =
target database supports temporary tables
@property
temporary_views =
target database supports temporary views
@property
text_type =
Target database must support an unbounded Text() " "type such as TEXT or CLOB
@property
threading_with_mock =
Mark tests that use threading and mock at the same time - stability issues have been observed with coverage + python 3.3
@property
time =
target dialect supports representation of Python datetime.time() objects.
@property
time_microseconds =
target dialect supports representation of Python datetime.time() with microsecond objects.
@property
time_timezone =
target dialect supports representation of Python datetime.time() with tzinfo with Time(timezone=True).
@property
timestamp_microseconds =
target dialect supports representation of Python datetime.datetime() with microsecond objects but only if TIMESTAMP is used.
@property
timestamp_microseconds_implicit_bound =
target dialect when given a datetime object which also includes a microseconds portion when using the TIMESTAMP data type will bind it such that the database server knows the object is a datetime with microseconds, and not a plain string.
@property
timing_intensive =

Undocumented

@property
tuple_in =
Target platform supports the syntax "(x, y) IN ((x1, y1), (x2, y2), ...)"
@property
tuple_in_w_empty =
Target platform tuple IN w/ empty set
@property
two_phase_transactions =
Target database must support two-phase transactions.
@property
unbounded_varchar =
Target database must support VARCHAR with no length
@property
unicode_connections =
Target driver must support non-ASCII characters being passed at all.
@property
unicode_data =
Target database/dialect must support Python unicode objects with non-ASCII characters represented, delivered as bound parameters as well as in result rows.
@property
unicode_ddl =
Target driver must support some degree of non-ascii symbol names.
@property
unique_constraint_reflection =
target dialect supports reflection of unique constraints
@property
update_from =
Target must support UPDATE..FROM syntax
@property
update_where_target_in_subquery =

Target must support UPDATE (or DELETE) where the same table is present in a subquery in the WHERE clause.

This is an ANSI-standard syntax that apparently MySQL can't handle, such as:

UPDATE documents SET flag=1 WHERE documents.title IN
    (SELECT max(documents.title) AS title
        FROM documents GROUP BY documents.user_id
    )
@property
view_column_reflection =

target database must support retrieval of the columns in a view, similarly to how a table is inspected.

This does not include the full CREATE VIEW definition.

@property
view_reflection =
target database must support inspection of the full CREATE VIEW definition.
@property
views =
Target database must support VIEWs.
@property
window_functions =
Target database must support window functions.