()
return database
Get db class from config.db.engine
Get db class from config.db.engine
Get db class from config . db . engine
def create():
        """Get db class from config.db.engine"""
        # TODO: make a utli.mapping
        if config.database['engine'] == 'sqlite3':
            database = SqliteDatabase()
        elif config.database['engine'] == 'postgresql':
            database = PostgreSQLDatabase()
        elif config.database['engine'] == 'mysql':
            database = MySQLDatabase()
        else:
            raise Exception(
                "Unsupported DB type. Supported types are "
                "postgresql/sqlite3 and mysql")
        database.initialize(config.debug)
        # Create all tables, if not already exists.
        Model.metadata.create_all(database.engine)
        # TODO DB: Run migrations
        return database
def create ( ) : # TODO: make a utli.mapping if config . database [ 'engine' ] == 'sqlite3' : database = SqliteDatabase ( ) elif config . database [ 'engine' ] == 'postgresql' : database = PostgreSQLDatabase ( ) elif config . database [ 'engine' ] == 'mysql' : database = MySQLDatabase ( ) else : raise Exception ( "Unsupported DB type. Supported types are " "postgresql/sqlite3 and mysql" ) database . initialize ( config . debug ) # Create all tables, if not already exists. Model . metadata . create_all ( database . engine ) # TODO DB: Run migrations return database