Commit Graph

23 Commits

Author SHA1 Message Date
Efim Poberezkin 7e9cfcce8c agent sqlite: rework schema, make methods transactional, enable foreign keys (#34)
* agent sqlite: rework schema

* agent sqlite: explicitly mark primary keys as NOT NULL

* agent sqlite: adjust connections and queues fkeys

* agent sqlite: remove ack_mode from queues tables

* [WIP] agent sqlite: refactor methods

* agent sqlite: implement transactional createRcvConn

* add comment

* agent sqlite: remove ConnAlias from createRcvConn signature

* agent sqlite: implement transactional createSndConn

* agent sqlite: remove monadic stack from store util methods

* agent sqlite: refactor getConn

* agent sqlite: rename conn -> dbConn

* agent sqlite: move transactional logic to utils

* agent sqlite: remove addServer from store interface

* fix comment

* agent sqlite: refactor getRcvQueue

* agent sqlite: refactor deleteConn

* agent sqlite: remove old deleteConn

* agent sqlite: enable FKs

* agent sqlite: refactor methods upgrading connection to duplex

* agent sqlite: uncomment not implemented methods

* agent sqlite: rename methods upgrading connection to duplex

* use liftEither

* agent sqlite: refactor update queue status methods

* agent sqlite: refactor createMsg

* clean up

* fix compilation errors in src

* fix existing tests

* clean up tests

* agent sqlite: test that foreign keys are enabled

* change private members naming

* tests: expect specific error code

* clean up

* agent sqlite: consistently separate lifts from logic to their own lines
2021-02-04 19:23:43 +04:00
Evgeny Poberezkin 1f61267308 chat prototype (#35)
* chat prototype

* chat prototype now compiles

* chat prototype works

* agent: respond SENT mId to SEND (instead of OK), ne repsonse to chat message in terminal

* chat prototype help, update commands

* chat CLI options

* add active contact to ChatClient (not used yet)

* refactor agentTransmission

* InviteContact -> AddContact

* automatically insert active contact

* highlight contact in chat

* name for invitations

* do not ask name on start

* change default server to smp.simplex.im
2021-02-26 18:13:04 +04:00
Efim Poberezkin e09d3bae99 agent store: move SQLite Types -> Util (#30) 2021-01-25 20:14:33 +04:00
Evgeny Poberezkin 19dc7b3389 subscriptions (#27)
* subscribe connection and track subscriptions

* notify client when subscription ENDs

* tcp connection timeout

* move types
2021-02-26 18:11:22 +04:00
Efim Poberezkin f50da16d0a reorganize Protocol and Agent Store (#25)
* chore: move members from Server/Transmission.hs to Protocol.hs

* chore: revert qualified SMP import for server and client

* chore: fix corrId call

* chore: move common types to Common.hs

* chore: decompose SQLite.hs

* chore: rename Agent/Transmission.hs ErrorType -> AgentErrorType

* chore: move Protocol ErrorType -> Common SMPErrorType

* chore: rename Common -> Types

* chore: revert SMPErrorType -> ErrorType
2021-02-26 18:11:22 +04:00
Evgeny Poberezkin c30a4cd1ff sql quasi-qouter (#26) 2021-02-26 18:11:22 +04:00
Efim Poberezkin 19238c6cc4 agent store: add deleteConn and tests 2021-01-07 17:58:46 +04:00
Efim Poberezkin e692cb0119 add addRcvQueue and tests 2021-01-07 14:00:53 +04:00
Evgeny Poberezkin 15cf2e9fff upsertServer: use select to get server ID 2021-01-04 10:39:20 +00:00
Evgeny Poberezkin 650971fa02 method to insert connection (#3) 2021-01-03 18:05:50 +00:00
Evgeny Poberezkin 3d4f43a051 add NOT NULL constraints 2021-01-03 12:47:12 +00:00
Efim Poberezkin 3c1834f93f implement addServer command 2020-12-30 18:54:17 +04:00
Efim Poberezkin 92d170f178 add queries drafts for insertion of server, queue, connection 2020-12-29 21:30:00 +04:00
Evgeny Poberezkin dabef7f0d1 use quasiqoutes for queries 2020-12-28 21:23:28 +00:00
Efim Poberezkin c47f583574 add unique constraints todo 2020-12-28 23:50:04 +04:00
Efim Poberezkin dea5c6478a change fields to blobs 2020-12-28 23:32:05 +04:00
Efim Poberezkin 205c6bf117 add servers table to database 2020-12-28 22:06:01 +04:00
Evgeny Poberezkin 02cb6068a2 create all tables 2020-12-27 21:32:30 +00:00
Efim Poberezkin a6bd03bf99 add agent ddl draft 2020-12-27 22:06:37 +04:00
Evgeny Poberezkin e418498334 move queries to code 2020-12-27 12:48:46 +00:00
Evgeny Poberezkin 18ab9650b4 move queries to code 2020-12-27 12:47:39 +00:00
Evgeny Poberezkin 7bcd5ebcef agent: creating schema 2020-12-27 10:26:08 +00:00
Evgeny Poberezkin a3b53f68c5 empty database schema 2020-12-26 21:22:17 +00:00