diff --git a/ckan/model/meta.py b/ckan/model/meta.py index 13dcf1cb1fc..b8d6b42cd65 100644 --- a/ckan/model/meta.py +++ b/ckan/model/meta.py @@ -153,14 +153,12 @@ def after_rollback(self, session): # names, you'll need a metadata for each database metadata = MetaData() + def engine_is_sqlite(): - """ - Returns true iff the engine is connected to a sqlite database. - """ + # Returns true iff the engine is connected to a sqlite database. return engine.url.drivername == 'sqlite' + def engine_is_pg(): - """ - Returns true iff the engine is connected to a postgresql database. - """ - return engine.url.drivername == 'psycopg2' + # Returns true iff the engine is connected to a postgresql database. + return engine.url.drivername in ['psycopg2', 'postgres']