Skip to content

Commit 3b43ee8

Browse files
committed
Add engine setup parameter for non-Postgres DBs
1 parent 7d65283 commit 3b43ee8

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

example_config.ini

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ debug = True
66
secret = a super secretive string
77

88
[database]
9+
engine = postgresql
910
username = grice
1011
password = grice
1112
host = localhost

grice/db_service.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def init_database(db_config):
3636
msg = '"username", "password", "host", "port", and "database" are required fields of database config'
3737
raise ConfigurationError(msg)
3838

39-
eng_url = engine.url.URL('postgresql', **db_args)
39+
eng_url = engine.url.URL(db_config.get('engine', 'postgresql'), **db_args)
4040

4141
return create_engine(eng_url)
4242

0 commit comments

Comments
 (0)