Пример #1
0
def add_racepoint(data):
    sqldata = utils.build_sql_insert_cols(data)
    session.cursor.execute(
        "INSERT OR IGNORE INTO Racepoints(%(columns)s) VALUES(%(values)s)" %
        sqldata, data)
    session.connection.commit()
    return session.cursor.lastrowid
Пример #2
0
def add_address(data):
    sqldata = utils.build_sql_insert_cols(data)
    session.cursor.execute(
        "INSERT INTO Addresses(%(columns)s) VALUES(%(values)s)" % sqldata,
        data)
    session.connection.commit()
    return session.cursor.lastrowid
Пример #3
0
def add_pigeon(data):
    sqldata = utils.build_sql_insert_cols(data)
    try:
        session.cursor.execute(
            "INSERT INTO Pigeons(%(columns)s) VALUES(%(values)s)" % sqldata,
            data)
    except sqlite3.IntegrityError as exc:
        raise InvalidValueError(exc)
    session.connection.commit()
    return session.cursor.lastrowid
Пример #4
0
def add_status(table, data):
    if not table in main.Schema.get_table_names():
        raise ValueError("Invalid table name '%s'" % table)
    sqldata = utils.build_sql_insert_cols(data)
    sqldata["table"] = table
    session.cursor.execute(
        "INSERT INTO %(table)s(%(columns)s) VALUES(%(values)s)" % sqldata,
        data)
    session.connection.commit()
    return session.cursor.lastrowid