nsertMachine :: DBInfo -> MachineId-> IO DBInfo
insertMachine dbi mid = do
    let conn     = db_connection dbi
        traceKey = db_traceKey   dbi
    machineKey <- head <$> query conn insertMachineQuery (mid, traceKey)
    case machineKey of
        Only key -> do
            return $ dbi {
                db_machines   = M.insert mid key (db_machines dbi)
                }
        _       -> error "machine insertion failed"

insertMachine :: DBInfo -> MachineId-> IO DBInfo
insertMachine dbi mid = do
    let conn     = db_connection dbi
        traceKey = db_traceKey   dbi
    machineKey <- head <$> query conn insertMachineQuery (mid, traceKey)
    case machineKey of
        Only key -> do
            return $ dbi {
                db_machines   = M.insert mid key (db_machines dbi)
                }
        _       -> error "machine insertion failed"
insertMachine dbi mid = do
    let conn     = db_connection dbi
        traceKey = db_traceKey   dbi
    machineKey <- head <$> query conn insertMachineQuery (mid, traceKey)
    case machineKey of
        Only key -> do
            return $ dbi {
                db_machines   = M.insert mid key (db_machines dbi)
                }
        _       -> error "machine insertion failed"