carto.py 文件源码

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

项目:the-el 作者: CityOfPhiladelphia 项目源码 文件源码
def create_table(table_name, load_postgis, json_table_schema, if_not_exists, indexes_fields, connection_string):
    if load_postgis:
        load_postgis_support()

    creds = re.match(carto_connection_string_regex, connection_string).groups()
    statement = CreateTable(get_table(table_name, json_table_schema))
    str_statement = statement.compile(dialect=postgresql.dialect())

    if if_not_exists:
        str_statement = str(str_statement).replace('CREATE TABLE', 'CREATE TABLE IF NOT EXISTS')

    carto_sql_call(creds, str_statement)

    if indexes_fields:
        create_indexes(creds, table_name, indexes_fields)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号