Skip to content

Commit

Permalink
Merge branch '345-fix-pg-detection'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Hammond committed Feb 4, 2013
2 parents ca1a7d7 + e5485d9 commit 854a0e6
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions ckan/model/meta.py
Expand Up @@ -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']

0 comments on commit 854a0e6

Please sign in to comment.