run lists if queries

This commit is contained in:
j 2016-01-19 15:11:07 +05:30
parent e5995a6423
commit 8c5e39448b

View file

@ -80,8 +80,11 @@ class MutableDict(Mutable, dict):
self.changed() self.changed()
def run_sql(sql): def run_sql(sql):
if isinstance(sql, str):
sql = [sql]
with session() as s: with session() as s:
s.connection().execute(sql) for q in sql:
s.connection().execute(q)
s.commit() s.commit()
def table_exists(table): def table_exists(table):