本文整理汇总了Python中sqlalchemy.testing.exclusions.only_on函数的典型用法代码示例。如果您正苦于以下问题:Python only_on函数的具体用法?Python only_on怎么用?Python only_on使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了only_on函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: update_from
def update_from(self):
"""Target must support UPDATE..FROM syntax"""
return only_on(
["postgresql", "mssql", "mysql"],
"Backend does not support UPDATE..FROM",
)
示例2: reflects_json_type
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"
])
示例3: array_type
def array_type(self):
return only_on(
[
lambda config: against(config, "postgresql")
and not against(config, "+pg8000")
and not against(config, "+zxjdbc")
]
)
示例4: cross_schema_fk_reflection
def cross_schema_fk_reflection(self):
"""target system must support reflection of inter-schema foreign keys
"""
return only_on([
"postgresql",
"mysql",
"mssql",
])
示例5: implicit_default_schema
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"])
示例6: isolation_level
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",
)
示例7: psycopg2_or_pg8000_compatibility
def psycopg2_or_pg8000_compatibility(self):
return only_on(
[
"postgresql+psycopg2",
"postgresql+psycopg2cffi",
"postgresql+pg8000",
]
)
示例8: json_type
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: mssql_freetds
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: ctes_with_update_delete
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: ctes
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: json_type
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: autocommit
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")
示例14: temporary_views
def temporary_views(self):
"""target database supports temporary views"""
return only_on(['sqlite', 'postgresql'])
示例15: psycopg2_compatibility
def psycopg2_compatibility(self):
return only_on(
["postgresql+psycopg2", "postgresql+psycopg2cffi"]
)