Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@sqlite_table
def TableOne(context):
context.resources.conn.execute('''CREATE TABLE TableOne AS SELECT 1 as num''')
context.resources.conn.commit()
@sqlite_table(name=name, input_tables=input_tables)
def Table(context, **_kwargs):
context.resources.conn.execute(sql_text)
context.resources.conn.commit()
@sqlite_table
def TableTwo(context):
context.resources.conn.execute('''CREATE TABLE TableTwo AS SELECT 2 as num''')
context.resources.conn.commit()
@sqlite_table(
input_tables=[input_table('table_one', TableOne), input_table('table_two', TableTwo)]
)
def TableThree(context, **_kwargs):
context.resources.conn.execute(
'CREATE TABLE TableThree AS SELECT num from TableOne UNION SELECT num from TableTwo'
)
context.resources.conn.commit()