Skip to content

Commit d16b7ec

Browse files
author
Stephanie Reeder
committed
add schema check to sqlite connection in ODMconnection.py
1 parent aadcc5b commit d16b7ec

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/api/ODMconnection.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,16 @@ def createConnection(self, engine, address, db=None, user=None, password=None, d
6767

6868
if engine == 'sqlite':
6969
connection_string = engine +':///'+address
70-
return SessionFactory(connection_string, echo = False, version= dbtype)
70+
s = SessionFactory(connection_string, echo = False, version= dbtype)
71+
self._setSchema(s.engine)
72+
return s
7173

7274
else:
7375
connection_string = dbconnection.buildConnDict(dbconnection(), engine, address, db, user, password)
7476
if self.isValidConnection(connection_string, dbtype):
75-
return SessionFactory(connection_string, echo = False, version= dbtype)
77+
s= SessionFactory(connection_string, echo = False, version= dbtype)
78+
self._setSchema(s.engine)
79+
return s
7680
else :
7781
return None
7882
# if self.testConnection(connection_string):

0 commit comments

Comments
 (0)