diff --git a/transport/disk.py b/transport/disk.py index f092a3d..956386d 100644 --- a/transport/disk.py +++ b/transport/disk.py @@ -209,17 +209,20 @@ class SQLiteWriter(SQLite,DiskWriter) : """ """ - if not self.fields : - if type(info) == pd.DataFrame : - _columns = list(info.columns) - self.init(list(info.keys())) + #if not self.fields : + # #if type(info) == pd.DataFrame : + # # _columns = list(info.columns) + # #self.init(list(info.keys())) if type(info) == dict : info = [info] elif type(info) == pd.DataFrame : info = info.fillna('') info = info.to_dict(orient='records') - + if not self.fields : + _rec = info[0] + self.init(list(_rec.keys())) + SQLiteWriter.LOCK.acquire() try: @@ -238,4 +241,4 @@ class SQLiteWriter(SQLite,DiskWriter) : except Exception as e : print (e) pass - SQLiteWriter.LOCK.release() \ No newline at end of file + SQLiteWriter.LOCK.release() diff --git a/transport/providers.py b/transport/providers.py index a798960..23843e7 100644 --- a/transport/providers.py +++ b/transport/providers.py @@ -72,6 +72,7 @@ WRITE = {'sql':sql.SQLWriter,'nosql':{MONGODB:mongo.MongoWriter,COUCHDB:couch.Co PROVIDERS = { FILE:{'read':disk.DiskReader,'write':disk.DiskWriter}, SQLITE:{'read':disk.SQLiteReader,'write':disk.SQLiteWriter,'driver':sqlite3}, + 'sqlite3':{'read':disk.SQLiteReader,'write':disk.SQLiteWriter,'driver':sqlite3}, POSTGRESQL:{'read':sql.SQLReader,'write':sql.SQLWriter,'driver':pg,'default':{'host':'localhost','port':5432}}, NETEZZA:{'read':sql.SQLReader,'write':sql.SQLWriter,'driver':nz,'default':{'port':5480}}, @@ -98,4 +99,4 @@ DEFAULT = {PG:{'host':'localhost','port':5432},MYSQL:{'host':'localhost','port': DEFAULT[MONGODB] = {'port':27017,'host':'localhost'} DEFAULT[REDSHIFT] = DEFAULT[PG] DEFAULT[MARIADB] = DEFAULT[MYSQL] -DEFAULT[NETEZZA] = {'port':5480} \ No newline at end of file +DEFAULT[NETEZZA] = {'port':5480}