|
|
@ -15,6 +15,7 @@ class Base:
|
|
|
|
self._database = _args['database']
|
|
|
|
self._database = _args['database']
|
|
|
|
self._table = _args['table'] if 'table' in _args else None
|
|
|
|
self._table = _args['table'] if 'table' in _args else None
|
|
|
|
self._engine= sqa.create_engine(self._get_uri(**_args),future=True)
|
|
|
|
self._engine= sqa.create_engine(self._get_uri(**_args),future=True)
|
|
|
|
|
|
|
|
self._chunksize = 0 if 'chunksize' not in _args else _args['chunksize']
|
|
|
|
def _set_uri(self,**_args) :
|
|
|
|
def _set_uri(self,**_args) :
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
:provider provider
|
|
|
|
:provider provider
|
|
|
@ -60,7 +61,9 @@ class Base:
|
|
|
|
@TODO: Execution of stored procedures
|
|
|
|
@TODO: Execution of stored procedures
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
if sql.lower().startswith('select') or sql.lower().startswith('with') :
|
|
|
|
if sql.lower().startswith('select') or sql.lower().startswith('with') :
|
|
|
|
|
|
|
|
if self._chunksize :
|
|
|
|
|
|
|
|
return pd.read_sql(sql,self._engine,chunksize=self._chunksize)
|
|
|
|
|
|
|
|
else:
|
|
|
|
return pd.read_sql(sql,self._engine)
|
|
|
|
return pd.read_sql(sql,self._engine)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
_handler = self._engine.connect()
|
|
|
|
_handler = self._engine.connect()
|
|
|
|