From 2e761b20f6e0a59983bacd7b876157124697fda4 Mon Sep 17 00:00:00 2001 From: Efim Poberezkin Date: Mon, 4 Jan 2021 18:01:11 +0400 Subject: [PATCH] remove commented queries --- src/Simplex/Messaging/Agent/Store/SQLite.hs | 59 --------------------- 1 file changed, 59 deletions(-) diff --git a/src/Simplex/Messaging/Agent/Store/SQLite.hs b/src/Simplex/Messaging/Agent/Store/SQLite.hs index 9b8d2e90e..cc4b46458 100644 --- a/src/Simplex/Messaging/Agent/Store/SQLite.hs +++ b/src/Simplex/Messaging/Agent/Store/SQLite.hs @@ -205,62 +205,3 @@ instance MonadUnliftIO m => MonadAgentStore SQLiteStore m where qId <- insertSndQueue st serverId sndQueue -- TODO test for duplicate connAlias insertSndConnection st connAlias qId return $ SendConnection connAlias sndQueue - --- id <- query conn "INSERT ..." --- query conn "INSERT ..." - --- sqlite queries to create server, queue and connection - --- *** step 1 - insert server before create request to server - --- ! "INSERT OR REPLACE INTO" with autoincrement apparently would change id, --- ! so going with "ON CONFLICT UPDATE" here - --- INSERT INTO servers (host_address, port, key_hash) --- VALUES ({host_address}, {port}, {key_hash}) --- ON CONFLICT(host_address, port) DO UPDATE SET --- host_address=excluded.host_address, --- port=excluded.port, --- key_hash=excluded.key_hash; - --- *** step 2 - insert queue and connection after server's response - --- BEGIN TRANSACTION; - --- INSERT INTO recipient_queues ( --- server_id, --- rcv_id, --- rcv_private_key, --- snd_id, --- snd_key, --- decrypt_key, --- verify_key, --- status, --- ack_mode --- ) --- VALUES ( --- {server_id}, --- {rcv_id}, --- {rcv_private_key}, --- {snd_id}, --- {snd_key}, --- {decrypt_key}, --- {verify_key}, --- {status}, --- {ack_mode} --- ); - --- INSERT INTO connections ( --- conn_alias, --- recipient_queue_id, --- sender_queue_id --- ) --- VALUES ( --- {conn_alias}, --- {recipient_queue_id}, --- NULL --- ); - --- COMMIT; - --- ***