schema.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:django-boardinghouse 作者: schinckel 项目源码 文件源码
def can_apply_to_multiple_schemata(sql, cursor):
    parsed = sqlparse.parse(sql)

    data = [
        get_table_and_schema(statement, cursor)
        for statement in parsed
    ]

    if any(match is False for match in data):
        return False

    data = [part for part in data if part is not None]

    # If all of our references to tables are shared, or schema-qualified, we
    # can't apply multiple times.
    if all(
        is_shared_table(table_name) or schema_name
        for (table_name, schema_name) in data
    ):
        return False

    return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号