def getConn(DB): global DSN if DSN is None: DSN = dbi.read_cnf() conn = dbi.connect(DSN) conn.select_db(DB) return conn
def getConn(db): # this line is to allow db connection on a personal account # dsn = dbi.read_cnf("~/.textbook.cnf") dsn = dbi.read_cnf() conn = dbi.connect(dsn) dbi.select_db(conn, db) return conn
def getConn(db): '''returns a database connection to the given database''' global DSN if DSN is None: DSN = dbi.read_cnf() conn = dbi.connect(DSN) conn.select_db(db) return conn
def getConn(db): '''Returns a database connection for that db''' dsn = dbi.read_cnf() conn = dbi.connect(dsn) conn.select_db(db) return conn
def getConn(): '''Return connection to bluemark_db''' dsn = dbi.read_cnf('~/cs304/BlueMarket/static/bluemarket_db.cnf') conn = dbi.connect(dsn) conn.select_db('bluemark_db') return conn
def getConn(db): # dsn = dbi. read_cnf("~/.textbook.cnf") dsn = dbi.read_cnf() conn = dbi.connect(dsn) dbi.select_db(conn, db) return conn