Merge pull request #14454 from Aradhya-Tripathi/at/patch/builder

feat: prepending `tab` to doctypes in query builder
This commit is contained in:
mergify[bot] 2021-10-14 11:09:42 +00:00 committed by GitHub
commit 00d137d1cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -28,6 +28,17 @@ class MariaDB(Base, MySQLQuery):
table = cls.DocType(table)
return super().from_(table, *args, **kwargs)
@classmethod
def into(cls, table, *args, **kwargs):
if isinstance(table, str):
table = cls.DocType(table)
return super().into(table, *args, **kwargs)
@classmethod
def update(cls, table, *args, **kwargs):
if isinstance(table, str):
table = cls.DocType(table)
return super().update(table, *args, **kwargs)
class Postgres(Base, PostgreSQLQuery):
field_translation = {"table_name": "relname", "table_rows": "n_tup_ins"}
@ -58,3 +69,15 @@ class Postgres(Base, PostgreSQLQuery):
table = cls.DocType(table)
return super().from_(table, *args, **kwargs)
@classmethod
def into(cls, table, *args, **kwargs):
if isinstance(table, str):
table = cls.DocType(table)
return super().into(table, *args, **kwargs)
@classmethod
def update(cls, table, *args, **kwargs):
if isinstance(table, str):
table = cls.DocType(table)
return super().update(table, *args, **kwargs)