Add ability to get info about one table
This commit is contained in:
parent
5b19188757
commit
936ae26f7b
1 changed files with 7 additions and 0 deletions
|
|
@ -137,6 +137,13 @@ class DBConnector:
|
||||||
conn.execute(stmt)
|
conn.execute(stmt)
|
||||||
self.removeTableMetadata(table_name)
|
self.removeTableMetadata(table_name)
|
||||||
|
|
||||||
|
def getTable(self, table_name: str):
|
||||||
|
stmt = SQL("SELECT * FROM tables_metadata WHERE table_name = {}").format(
|
||||||
|
Literal(table_name)
|
||||||
|
)
|
||||||
|
with self.connection() as conn:
|
||||||
|
return conn.execute(stmt).fetchone()
|
||||||
|
|
||||||
def insertIntoTable(self, table_name: str, columns: dict[str, Any]):
|
def insertIntoTable(self, table_name: str, columns: dict[str, Any]):
|
||||||
if len(columns) == 0:
|
if len(columns) == 0:
|
||||||
stmt = SQL("INSERT INTO {} DEFAULT VALUES").format(Identifier(table_name))
|
stmt = SQL("INSERT INTO {} DEFAULT VALUES").format(Identifier(table_name))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue