예제 #1
0
def table_to_ddl(table):
    return str(CreateTable(table).compile(
        dialect=dialect.RedshiftDialect()
    ))
def preparer():
    compiler = dialect.RedshiftDDLCompiler(dialect.RedshiftDialect(), None)
    return compiler.preparer
예제 #3
0
def compile_query(q):
    return str(
        q.compile(dialect=dialect.RedshiftDialect(),
                  compile_kwargs={'literal_binds': True}))
def test_rename_table():
    compiler = dialect.RedshiftDDLCompiler(dialect.RedshiftDialect(), None)
    sql = compiler.process(RenameTable("old", "new", "scheme"))
    assert sql == 'ALTER TABLE scheme."old" RENAME TO "new"'