예제 #1
0
 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"
     ])
예제 #2
0
    def update_from(self):
        """Target must support UPDATE..FROM syntax"""

        return only_on(
            ["postgresql", "mssql", "mysql"],
            "Backend does not support UPDATE..FROM",
        )
예제 #3
0
    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"])
예제 #4
0
 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",
     )
예제 #5
0
 def cross_schema_fk_reflection(self):
     """target system must support reflection of inter-schema foreign keys
     """
     return only_on([
                 "postgresql",
                 "mysql",
                 "mssql",
             ])
예제 #6
0
 def psycopg2_or_pg8000_compatibility(self):
     return only_on(
         [
             "postgresql+psycopg2",
             "postgresql+psycopg2cffi",
             "postgresql+pg8000",
         ]
     )
예제 #7
0
 def array_type(self):
     return only_on(
         [
             lambda config: against(config, "postgresql")
             and not against(config, "+pg8000")
             and not against(config, "+zxjdbc")
         ]
     )
예제 #8
0
 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"
     ])
예제 #9
0
 def mssql_freetds(self):
     return only_on(
         LambdaPredicate(
             lambda config: (
                 (against(config, 'mssql+pyodbc') and
                  config.db.dialect.freetds)
                 or against(config, 'mssql+pymssql')
             )
         )
     )
예제 #10
0
    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
        ])
예제 #11
0
    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"
        ])
예제 #12
0
 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"
     ])
예제 #13
0
 def comment_reflection(self):
     return only_on(['postgresql', 'mysql', 'oracle'])
예제 #14
0
 def cross_schema_fk_reflection(self):
     """target system must support reflection of inter-schema foreign keys
     """
     return only_on(["postgresql"])
예제 #15
0
 def temporary_views(self):
     """target database supports temporary views"""
     return only_on(['sqlite', 'postgresql'])
예제 #16
0
 def psycopg2_compatibility(self):
     return only_on(
         ["postgresql+psycopg2", "postgresql+psycopg2cffi"]
     )
예제 #17
0
 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')
예제 #18
0
 def temporary_views(self):
     """target database supports temporary views"""
     return only_on(["sqlite", "postgresql"])
예제 #19
0
 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)
     )
예제 #20
0
 def python_profiling_backend(self):
     return only_on([self._sqlite_memory_db])
예제 #21
0
 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",
     )
예제 #22
0
 def fk_constraint_option_reflection_onupdate_restrict(self):
     return only_on(["postgresql", "sqlite", self._mysql_80])
예제 #23
0
 def comment_reflection(self):
     return only_on(["postgresql", "mysql", "oracle"])
예제 #24
0
 def foreign_key_constraint_option_reflection_onupdate(self):
     return only_on(["postgresql", "mysql", "sqlite"])
예제 #25
0
 def mssql_freetds(self):
     return only_on(["mssql+pymssql"])
예제 #26
0
 def fk_constraint_option_reflection_ondelete_noaction(self):
     return only_on(["postgresql", "mysql", "sqlite"])
예제 #27
0
 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")
예제 #28
0
    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.")
예제 #29
0
 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")
예제 #30
0
 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",
     )
예제 #31
0
 def index_reflects_included_columns(self):
     return only_on(["greenplum >= 11"])
예제 #32
0
 def indexes_with_expressions(self):
     return only_on(["postgresql", "sqlite>=3.9.0"])
예제 #33
0
    def temp_table_names(self):
        """target dialect supports listing of temporary table names"""

        return only_on(['sqlite', 'oracle'])
예제 #34
0
    def temp_table_names(self):
        """target dialect supports listing of temporary table names"""

        return only_on(["sqlite", "oracle"]) + skip_if(self._sqlite_file_db)
예제 #35
0
 def indexes_with_expressions(self):
     return only_on(["postgresql", "sqlite>=3.9.0"])
예제 #36
0
 def temporary_views(self):
     """target database supports temporary views"""
     return only_on(["sqlite", "postgresql"]) + skip_if(
         self._sqlite_file_db)
예제 #37
0
    def update_from(self):
        """Target must support UPDATE..FROM syntax"""

        return only_on(['postgresql', 'mssql', 'mysql'],
                       "Backend does not support UPDATE..FROM")
예제 #38
0
 def array_type(self):
     return only_on([
         lambda config: against(config, "postgresql") and not against(
             config, "+pg8000")
     ])
예제 #39
0
    def temp_table_names(self):
        """target dialect supports listing of temporary table names"""

        return only_on(['sqlite', 'oracle'])
예제 #40
0
    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"])
예제 #41
0
 def mssql_freetds(self):
     return only_on(["mssql+pymssql"])
예제 #42
0
 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)
     )
예제 #43
0
 def tuple_in(self):
     return only_on(["mysql", "postgresql"])
예제 #44
0
 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')
예제 #45
0
    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.")
예제 #46
0
 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",
     )
예제 #47
0
 def comment_reflection(self):
     return only_on(["postgresql", "mysql", "oracle"])
예제 #48
0
    def autocommit_isolation(self):
        """target database should support 'AUTOCOMMIT' isolation level"""

        return exclusions.only_on("postgresql", "mysql")
예제 #49
0
 def fetch_ties(self):
     return only_on(["greenplum >= 13"])
예제 #50
0
 def unnamed_constraints(self):
     """constraints without names are supported."""
     return exclusions.only_on(["sqlite"])
예제 #51
0
    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'])
예제 #52
0
 def reflects_fk_options(self):
     return exclusions.only_on(["postgresql", "mysql", "sqlite"])
예제 #53
0
 def foreign_key_constraint_option_reflection(self):
     return only_on(['postgresql', 'mysql', 'sqlite'])
예제 #54
0
 def fk_initially(self):
     """backend supports INITIALLY option in foreign keys"""
     return exclusions.only_on(["postgresql"])
예제 #55
0
 def temporary_views(self):
     """target database supports temporary views"""
     return only_on(['sqlite', 'postgresql'])
예제 #56
0
 def fk_deferrable(self):
     """backend supports DEFERRABLE option in foreign keys"""
     return exclusions.only_on(["postgresql"])
예제 #57
0
 def psycopg2_or_pg8000_compatibility(self):
     return only_on(
         ["postgresql+psycopg2", "postgresql+psycopg2cffi",
          "postgresql+pg8000"]
     )
예제 #58
0
 def temporary_views(self):
     """target database supports temporary views"""
     return only_on(["sqlite", "postgresql"])
예제 #59
0
    def deferrable_fks(self):
        """target database must support deferrable fks"""

        return only_on(['oracle'])
예제 #60
0
    def deferrable_fks(self):
        """target database must support deferrable fks"""

        return only_on(['oracle'])