MCPcopy Create free account
hub / github.com/daniel2005d/mapXplore / _createDBEngine

Method _createDBEngine

dbConnector.py:26–41  ·  view source on GitHub ↗
(self, database=None, connection=None)

Source from the content-addressed store, hash-verified

24
25
26 def _createDBEngine(self, database=None, connection=None):
27 con = None
28 try:
29 if database is None and self._database is not None:
30 database = self._database
31
32 if self._dbms == 'postgres':
33 con = PostgreSQL(database.lower() if database is not None else None, self._connection if connection is None else connection)
34 elif self._dbms == 'sqlite':
35 con = SQLite(database, None)
36 if con:
37 con.test_connection()
38 except Exception as e:
39 raise e
40
41 return con

Callers 2

_get_cursorMethod · 0.95
_get_connectionMethod · 0.95

Calls 3

PostgreSQLClass · 0.90
SQLiteClass · 0.90
test_connectionMethod · 0.45

Tested by

no test coverage detected