コード例 #1
0
def insert_drone_order(drone_order: DroneOrder):
    '''
    Inserts the given drone_order into the table drone_order.
    '''
    change(
        'INSERT INTO drone_order VALUES (:id, :drone_id, :protocol, :finish_time)',
        vars(drone_order))
コード例 #2
0
def insert_drone(drone: Drone):
    '''
    Inserts the given drone into the table drone.
    '''
    change(
        'INSERT INTO drone VALUES (:id, :drone_id, :optimized, :glitched, :trusted_users, :last_activity)',
        vars(drone))
コード例 #3
0
def insert_storage(storage: Storage):
    '''
    Inserts the given storage into the table drone_order.
    '''
    change(
        'INSERT INTO storage VALUES (:id, :stored_by, :target_id, :purpose, :roles, :release_time)',
        vars(storage))
コード例 #4
0
def rename_drone_in_db(old_id: str, new_id: str):
    '''
    Changes the ID of a drone.
    '''
    change('UPDATE drone SET drone_id=:new_id WHERE drone_id=:old_id', {
        'new_id': new_id,
        'old_id': old_id
    })
コード例 #5
0
def delete_drone_order_by_drone_id(drone_id: str):
    '''
    Deletes the drone_order with the given drone_id.
    '''
    change('DELETE FROM drone_order WHERE drone_id = :drone_id',
           {'drone_id': drone_id})
コード例 #6
0
def delete_drone_order(id: int):
    '''
    Deletes the drone_order with the given ID.
    '''
    change('DELETE FROM drone_order WHERE id = :id', {'id': id})
コード例 #7
0
def delete_storage_by_target_id(target_id: str):
    '''
    Deletes the storage with the given target_id.
    '''
    change('DELETE FROM storage WHERE target_id = :target_id',
           {'target_id': target_id})
コード例 #8
0
def delete_storage(id: int):
    '''
    Deletes the storage with the given ID.
    '''
    change('DELETE FROM storage WHERE id = :id', {'id': id})