예제 #1
0
파일: sql.py 프로젝트: dumptruckusa/odo
def attach_schema(obj, schema):
    if schema is not None:
        ddl = CreateSchema(schema, quote=True)
        event.listen(
            obj, 'before_create',
            ddl.execute_if(callable_=should_create_schema,
                           dialect='postgresql'))
    return obj
예제 #2
0
파일: sql.py 프로젝트: pieterdavid/odo
def attach_schema(obj, schema):
    if schema is not None:
        ddl = CreateSchema(schema, quote=True)
        event.listen(obj,
                     'before_create',
                     ddl.execute_if(callable_=should_create_schema,
                                    dialect='postgresql'))
    return obj
예제 #3
0
def schema_ddl(schema: Schema):
    ddl = CreateSchema(schema.name)
    return ddl.execute_if(callable_=check_schema)