def get_db():
 if (not hasattr(g, 'sqlite_db')):
  g.sqlite_db = connect_db()
 return g.sqlite_db

def get_db ( ) : if ( not hasattr ( g , 'sqlite_db' ) ) : g . sqlite_db = connect_db ( ) return g . sqlite_db
opens a new database connection if there is none yet for the current application context .