(query, parameters=None)
return success
Generic insert/create/update query against the loaded database.
Generic insert/create/update query against the loaded database.
Generic insert / create / update query against the loaded database .
def insert(query, parameters=None):
    """ Generic insert/create/update query against the loaded database.
    """
    global db
    success = False
    try:
        cursor = db.connection.cursor()

        if parameters is None:
            cursor.execute(query)
        else:
            cursor.execute(query, parameters)

        db.connection.commit()
        success = True
    except:
        success = False    # unique violation/doesnt exist/etc.
    return success
def insert ( query , parameters = None ) : global db success = False try : cursor = db . connection . cursor ( ) if parameters is None : cursor . execute ( query ) else : cursor . execute ( query , parameters ) db . connection . commit ( ) success = True except : success = False # unique violation/doesnt exist/etc. return success