def reflects_json_type(self): return only_on([ lambda config: against(config, "mysql >= 5.7") and not config.db.dialect._is_mariadb, "postgresql >= 9.3", "sqlite >= 3.9" ])
def update_from(self): """Target must support UPDATE..FROM syntax""" return only_on( ["postgresql", "mssql", "mysql"], "Backend does not support UPDATE..FROM", )
def implicit_default_schema(self): """target system has a strong concept of 'default' schema that can be referred to implicitly. basically, PostgreSQL. """ return only_on(["postgresql"])
def isolation_level(self): return only_on( ("postgresql", "sqlite", "mysql", "mssql"), "DBAPI has no isolation level support", ) + fails_on( "postgresql+pypostgresql", "pypostgresql bombs on multiple isolation level calls", )
def cross_schema_fk_reflection(self): """target system must support reflection of inter-schema foreign keys """ return only_on([ "postgresql", "mysql", "mssql", ])
def psycopg2_or_pg8000_compatibility(self): return only_on( [ "postgresql+psycopg2", "postgresql+psycopg2cffi", "postgresql+pg8000", ] )
def array_type(self): return only_on( [ lambda config: against(config, "postgresql") and not against(config, "+pg8000") and not against(config, "+zxjdbc") ] )
def json_type(self): return only_on([ lambda config: against(config, "mysql >= 5.7") and not config.db.dialect._is_mariadb and # workaround for: # https://github.com/PyMySQL/PyMySQL/issues/488 not (config.db.dialect.driver == 'pymysql'), "postgresql >= 9.3" ])
def mssql_freetds(self): return only_on( LambdaPredicate( lambda config: ( (against(config, 'mssql+pyodbc') and config.db.dialect.freetds) or against(config, 'mssql+pymssql') ) ) )
def ctes_with_update_delete(self): """target database supports CTES that ride on top of a normal UPDATE or DELETE statement which refers to the CTE in a correlated subquery. """ return only_on([ "postgresql", "mssql", # "oracle" - oracle can do this but SQLAlchemy doesn't support # their syntax yet ])
def ctes(self): """Target database supports CTEs""" return only_on([ lambda config: against(config, "mysql") and ( config.db.dialect._is_mariadb and config.db.dialect._mariadb_normalized_version_info >= (10, 2) ), "postgresql", "mssql", "oracle" ])
def json_type(self): return only_on([ lambda config: against(config, "mysql") and ( ( not config.db.dialect._is_mariadb and against(config, "mysql >= 5.7") ) or ( config.db.dialect._mariadb_normalized_version_info >= (10, 2, 7) ) ), "postgresql >= 9.3" ])
def comment_reflection(self): return only_on(['postgresql', 'mysql', 'oracle'])
def cross_schema_fk_reflection(self): """target system must support reflection of inter-schema foreign keys """ return only_on(["postgresql"])
def temporary_views(self): """target database supports temporary views""" return only_on(['sqlite', 'postgresql'])
def psycopg2_compatibility(self): return only_on( ["postgresql+psycopg2", "postgresql+psycopg2cffi"] )
def isolation_level(self): return only_on( ('postgresql', 'sqlite', 'mysql'), "DBAPI has no isolation level support") + fails_on( 'postgresql+pypostgresql', 'pypostgresql bombs on multiple isolation level calls')
def temporary_views(self): """target database supports temporary views""" return only_on(["sqlite", "postgresql"])
def postgresql_jsonb(self): return only_on("postgresql >= 9.4") + skip_if( lambda config: config.db.dialect.driver == "pg8000" and config.db.dialect._dbapi_version <= (1, 10, 1) )
def python_profiling_backend(self): return only_on([self._sqlite_memory_db])
def autocommit(self): """target dialect supports 'AUTOCOMMIT' as an isolation_level""" return only_on( ("postgresql", "mysql", "mssql+pyodbc", "mssql+pymssql"), "dialect does not support AUTOCOMMIT isolation mode", )
def fk_constraint_option_reflection_onupdate_restrict(self): return only_on(["postgresql", "sqlite", self._mysql_80])
def comment_reflection(self): return only_on(["postgresql", "mysql", "oracle"])
def foreign_key_constraint_option_reflection_onupdate(self): return only_on(["postgresql", "mysql", "sqlite"])
def mssql_freetds(self): return only_on(["mssql+pymssql"])
def fk_constraint_option_reflection_ondelete_noaction(self): return only_on(["postgresql", "mysql", "sqlite"])
def autocommit(self): """target dialect supports 'AUTOCOMMIT' as an isolation_level""" return only_on( ('postgresql', 'mysql', 'mssql+pyodbc', 'mssql+pymssql'), "dialect does not support AUTOCOMMIT isolation mode")
def sequences_as_server_defaults(self): """Target database must support SEQUENCE as a server side default.""" return only_on("postgresql", "doesn't support sequences as a server side default.")
def delete_from(self): """Target must support DELETE FROM..FROM or DELETE..USING syntax""" return only_on(['postgresql', 'mssql', 'mysql', 'sybase'], "Backend does not support DELETE..FROM")
def delete_from(self): """Target must support DELETE FROM..FROM or DELETE..USING syntax""" return only_on( ["postgresql", "mssql", "mysql", "sybase"], "Backend does not support DELETE..FROM", )
def index_reflects_included_columns(self): return only_on(["greenplum >= 11"])
def indexes_with_expressions(self): return only_on(["postgresql", "sqlite>=3.9.0"])
def temp_table_names(self): """target dialect supports listing of temporary table names""" return only_on(['sqlite', 'oracle'])
def temp_table_names(self): """target dialect supports listing of temporary table names""" return only_on(["sqlite", "oracle"]) + skip_if(self._sqlite_file_db)
def temporary_views(self): """target database supports temporary views""" return only_on(["sqlite", "postgresql"]) + skip_if( self._sqlite_file_db)
def update_from(self): """Target must support UPDATE..FROM syntax""" return only_on(['postgresql', 'mssql', 'mysql'], "Backend does not support UPDATE..FROM")
def array_type(self): return only_on([ lambda config: against(config, "postgresql") and not against( config, "+pg8000") ])
def timestamp_microseconds(self): """target dialect supports representation of Python datetime.datetime() with microsecond objects but only if TIMESTAMP is used.""" return only_on(["oracle"])
def tuple_in(self): return only_on(["mysql", "postgresql"])
def isolation_level(self): return only_on( ('postgresql', 'sqlite', 'mysql'), "DBAPI has no isolation level support" ).fails_on('postgresql+pypostgresql', 'pypostgresql bombs on multiple isolation level calls')
def sequences_as_server_defaults(self): """Target database must support SEQUENCE as a server side default.""" return only_on( 'postgresql', "doesn't support sequences as a server side default.")
def autocommit_isolation(self): """target database should support 'AUTOCOMMIT' isolation level""" return exclusions.only_on("postgresql", "mysql")
def fetch_ties(self): return only_on(["greenplum >= 13"])
def unnamed_constraints(self): """constraints without names are supported.""" return exclusions.only_on(["sqlite"])
def timestamp_microseconds(self): """target dialect supports representation of Python datetime.datetime() with microsecond objects but only if TIMESTAMP is used.""" return only_on(['oracle'])
def reflects_fk_options(self): return exclusions.only_on(["postgresql", "mysql", "sqlite"])
def foreign_key_constraint_option_reflection(self): return only_on(['postgresql', 'mysql', 'sqlite'])
def fk_initially(self): """backend supports INITIALLY option in foreign keys""" return exclusions.only_on(["postgresql"])
def fk_deferrable(self): """backend supports DEFERRABLE option in foreign keys""" return exclusions.only_on(["postgresql"])
def psycopg2_or_pg8000_compatibility(self): return only_on( ["postgresql+psycopg2", "postgresql+psycopg2cffi", "postgresql+pg8000"] )
def deferrable_fks(self): """target database must support deferrable fks""" return only_on(['oracle'])