bug fix & version update, using schemas read/write

v2.4
Steve Nyemba 1 month ago
parent c1bc167b7f
commit cdeebd3ce4

@ -103,14 +103,22 @@ def supported (format:Annotated[str,typer.Argument(help="format of the output, s
else: else:
print (_df) print (_df)
print () print ()
@app_i.command(name="version")
def version ():
"""
This function will return the version of the data-transport
"""
print()
print (f'[bold] {transport.__app_name__} ,[blue] {transport.__edition__} edition [/blue], version {transport.__version__}[/bold]')
print ()
@app_i.command(name="license") @app_i.command(name="license")
def info(): def info():
""" """
This function will display version and license information This function will display version and license information
""" """
print()
print (f'[bold] {transport.__app_name__} ,version {transport.__version__}[/bold]') print (f'[bold] {transport.__app_name__} ,{transport.__edition__}, version {transport.__version__}[/bold]')
print () print ()
print (transport.__license__) print (transport.__license__)

@ -1,7 +1,7 @@
__app_name__ = 'data-transport' __app_name__ = 'data-transport'
__author__ = 'The Phi Technology' __author__ = 'The Phi Technology'
__version__= '2.4.18' __version__= '2.4.18'
__edition__= 'ent' __edition__= 'enterprise'
__email__ = "info@the-phi.com" __email__ = "info@the-phi.com"
__license__=f""" __license__=f"""
Copyright 2010 - 2024, Steve L. Nyemba Copyright 2010 - 2024, Steve L. Nyemba

@ -83,6 +83,7 @@ class Base:
class SQLBase(Base): class SQLBase(Base):
def __init__(self,**_args): def __init__(self,**_args):
super().__init__(**_args) super().__init__(**_args)
self._schema = _args.get('schema',None)
def get_provider(self): def get_provider(self):
raise Exception ("Provider Needs to be set ...") raise Exception ("Provider Needs to be set ...")
def get_default_port(self) : def get_default_port(self) :
@ -122,6 +123,8 @@ class BaseReader(SQLBase):
sql = _args['sql'] sql = _args['sql']
else: else:
_table = _args['table'] if 'table' in _args else self._table _table = _args['table'] if 'table' in _args else self._table
if self._schema and type(self._schema) == str :
_table = f'{self._schema}.{_table}'
sql = f'SELECT * FROM {_table}' sql = f'SELECT * FROM {_table}'
return self.apply(sql) return self.apply(sql)
@ -151,5 +154,9 @@ class BaseWriter (SQLBase):
# _mode['schema'] = _args['schema'] # _mode['schema'] = _args['schema']
# if 'if_exists' in _args : # if 'if_exists' in _args :
# _mode['if_exists'] = _args['if_exists'] # _mode['if_exists'] = _args['if_exists']
if 'schema' in _args and type(_args['schema']) == str:
self._schema = _args.get('schema',None)
if self._schema :
_mode['schema'] = self._schema
_df.to_sql(_table,self._engine,**_mode)
_df.to_sql(_table,self._engine,**_mode) _df.to_sql(_table,self._engine,**_mode)
Loading…
Cancel
Save