bug fix sqlalchemy dispose connection

pull/1/head
Steve Nyemba 11 months ago
parent a4b4a453bb
commit e7df1e967f

@ -1,6 +1,6 @@
__app_name__ = 'data-transport' __app_name__ = 'data-transport'
__author__ = 'The Phi Technology' __author__ = 'The Phi Technology'
__version__= '2.4.14' __version__= '2.4.16'
__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

@ -100,7 +100,11 @@ class SQLBase(Base):
# _uri = [_item.strip() for _item in _uri if _item.strip()] # _uri = [_item.strip() for _item in _uri if _item.strip()]
# return '/'.join(_uri) # return '/'.join(_uri)
return f'{_provider}://{_host}/{_database}' if _account == '' else f'{_provider}://{_account}{_host}/{_database}' return f'{_provider}://{_host}/{_database}' if _account == '' else f'{_provider}://{_account}{_host}/{_database}'
def close(self,) :
try:
self._engine.dispose()
except :
pass
class BaseReader(SQLBase): class BaseReader(SQLBase):
def __init__(self,**_args): def __init__(self,**_args):
super().__init__(**_args) super().__init__(**_args)
@ -142,4 +146,4 @@ class BaseWriter (SQLBase):
# if 'if_exists' in _args : # if 'if_exists' in _args :
# _mode['if_exists'] = _args['if_exists'] # _mode['if_exists'] = _args['if_exists']
_df.to_sql(_table,self._engine,**_mode) _df.to_sql(_table,self._engine,**_mode)

Loading…
Cancel
Save