loader.py 文件源码

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

项目:baconql 作者: lsenta 项目源码 文件源码
def tokenize_content(file_path, content):
    """
    Take a SQL file with multiple statements,
    returns a list of blocks.
    """
    sql_blocks = sqlparse.split(content)
    sql_blocks = filter(None, sql_blocks)

    if not sql_blocks:
        return

    def builder(content, has_body=False):
        return Block(file_path, has_body, content)

    for block in sql_blocks:
        # would have used `yield from' below but py2...
        for r in _extract_parts(builder, block.split('\n')):
            yield r
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号