|
|
|
@ -34,7 +34,7 @@ class Base:
|
|
|
|
|
:table optional name of the table (can be fully qualified)
|
|
|
|
|
"""
|
|
|
|
|
_table = self._table if 'table' not in _args else _args['table']
|
|
|
|
|
_map = {'BIGINT':'INTEGER','TEXT':'STRING','DOUBLE_PRECISION':'FLOAT','NUMERIC':'FLOAT','DECIMAL':'FLOAT','REAL':'FLOAT'}
|
|
|
|
|
_map = {'TINYINT':'INTEGER','BIGINT':'INTEGER','TEXT':'STRING','DOUBLE_PRECISION':'FLOAT','NUMERIC':'FLOAT','DECIMAL':'FLOAT','REAL':'FLOAT'}
|
|
|
|
|
_schema = []
|
|
|
|
|
# if _table :
|
|
|
|
|
# if sqa.__version__.startswith('1.') :
|
|
|
|
@ -53,7 +53,7 @@ class Base:
|
|
|
|
|
|
|
|
|
|
_inspector = inspect(self._engine)
|
|
|
|
|
_columns = _inspector.get_columns(_table)
|
|
|
|
|
_schema = [{'name':column['name'],'type':str(column['type']) } for column in _columns]
|
|
|
|
|
_schema = [{'name':column['name'],'type':_map.get(str(column['type']),str(column['type'])) } for column in _columns]
|
|
|
|
|
return _schema
|
|
|
|
|
def has(self,**_args):
|
|
|
|
|
return self.meta(**_args)
|
|
|
|
|