import sqlite3


def openDatabase(file,inMemory=False):
    """Open SQLite db and return tuple (connection,cursor)"""
    if inMemory==True:
        conn=sqlite3.connect(':memory:')
    else:
        conn=sqlite3.connect(file)
    conn.row_factory = sqlite3.Row
    cursor=conn.cursor()    
    return (conn,cursor)