Skip to content

Updated db_modules.py for db2

Platipus edited this page Sep 13, 2024 · 2 revisions

SQLITE, FIREBIRD, POSTGRESQL, MYSQL, ORACLE, MSSQL, DB2 = range(1, 8)
DB_TYPE = ('Sqlite', 'FireBird', 'PostgreSQL', 'MySQL', 'Oracle', 'MSSQL', 'DB2')

def get_db_module(db_type):
    db = None
    if db_type == SQLITE:
        import jam.db.sqlite as db
    elif db_type == POSTGRESQL:
        import jam.db.postgres as db
    elif db_type == MYSQL:
        import jam.db.mysql as db
    elif db_type == FIREBIRD:
        import jam.db.firebird as db
    elif db_type == ORACLE:
        import jam.db.oracle as db
    elif db_type == MSSQL:
        import jam.db.mssql as db
    elif db_type == DB2:
        import jam.db.db2 as db
    return db
Clone this wiki locally