Explicitly query table column names
This commit is contained in:
parent
32870c8a8a
commit
7ba14e20b5
1 changed files with 4 additions and 1 deletions
|
@ -96,7 +96,10 @@ class Database():
|
||||||
return cr
|
return cr
|
||||||
|
|
||||||
def query(self, table, values=dict(), order_by=list()):
|
def query(self, table, values=dict(), order_by=list()):
|
||||||
sql = f"select * from {table.name}"
|
sql = "select %s from %s" % (
|
||||||
|
', '.join(table.columns),
|
||||||
|
table.name
|
||||||
|
)
|
||||||
|
|
||||||
if len(values) > 0:
|
if len(values) > 0:
|
||||||
sql += " where "
|
sql += " where "
|
||||||
|
|
Loading…
Add table
Reference in a new issue