bug fix, making table when provided a schema

This commit is contained in:
Steve Nyemba 2023-07-09 17:51:09 -05:00
parent f57cd8d871
commit 1885e3a5f6
1 changed files with 2 additions and 2 deletions

View File

@ -129,7 +129,7 @@ class SQLRW :
return self.schema +'.'+name if self.schema not in [None, ''] and '.' not in name else name return self.schema +'.'+name if self.schema not in [None, ''] and '.' not in name else name
def has(self,**_args): def has(self,**_args):
return self.meta(**_args) return len(self.meta(**_args)) > 0
# found = False # found = False
# try: # try:
@ -305,7 +305,7 @@ class SQLWriter(SQLRW,Writer):
if 'schema' in _args : if 'schema' in _args :
if type(_args['schema']) == str : if type(_args['schema']) == str :
self.schema = _args['schema'] if 'schema' in _args else self.schema self.schema = _args['schema'] if 'schema' in _args else self.schema
elif type(_args['schema']) == list: elif type(_args['schema']) == list and not self.has(table):
self.make(table=table,schema=_args['schema']) self.make(table=table,schema=_args['schema'])
pass pass
# self.schema = _args['schema'] if 'schema' in _args else self.schema # self.schema = _args['schema'] if 'schema' in _args else self.schema