Convert to SQLx and SQLite #64

Manually merged
projectmoon merged 17 commits from sqlite into master 2021-05-20 15:34:52 +00:00

17 Commits

Author SHA1 Message Date
projectmoon 5630b4ed20 Add sled migration utility.
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2021-05-20 15:30:44 +00:00
projectmoon 6b6be06c89 Update sqlx offline json.
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2021-05-19 21:36:16 +00:00
projectmoon a3b39ee42c Use ON CONFLICT and transactions where appropriate.
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2021-05-19 21:34:11 +00:00
projectmoon 7eee16961e Add tests for dbstate.
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2021-05-19 21:16:39 +00:00
projectmoon 43d8f9574f Allow 'upserts' in insert_room_info. Add a few more room db tests. 2021-05-19 21:06:28 +00:00
projectmoon 1c4cd3d139 Add tests for rooms db API
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2021-05-18 22:15:03 +00:00
projectmoon d1c04b8817 Tests for all of the variables DB api.
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2021-05-18 21:39:48 +00:00
projectmoon 5e899cd962 Return key not found error if value not found for user.
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2021-05-18 15:37:20 +00:00
projectmoon 257f3a066c Some user variable tests.
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2021-05-18 15:17:30 +00:00
projectmoon e539dcac1f Move migrations to sqlite directory. Remove in-memory temp db until refinery supports sqlx.
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2021-05-18 14:50:49 +00:00
projectmoon 9f97a6cb43 Implement variable count; fix listing all variables returning values for all users.
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2021-05-18 14:27:15 +00:00
projectmoon a665293268 Fix recording of room users, better logging.
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
- Fix constraint violations when recording users in rooms (migration fix).
 - Switched to tracing_subscriber to get log events from matrix SDK.
 - Remove "Applying migration" messages, and rely on refinery to log instead.
 - Log when an outgoing error is encountered.
2021-05-17 23:12:27 +00:00
projectmoon 66fb6e7cf8 Fix various issues with room events and related logic.
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
- Processing events multiple times when re-joining rooms.
 - Always thinking we've not processed an event/constraint
   violations (arguments were reversed in record_event).
 - Not handling errors when fetchin users in a room, and instead
   just suppressing them. Now, we handle errors!
 - Also update dependencies (attempt to fix ID too big bug, but no
   fix).
2021-05-16 22:24:27 +00:00
projectmoon bfc5609ab6 Add proper constraints to db tables. Report errors when listing users.
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2021-05-16 21:39:19 +00:00
projectmoon 9798821b7b Implement room and dbstate for sqlite.
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2021-05-16 14:29:57 +00:00
projectmoon cf9ce63892 Replace application-level database connectivity.
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
- Some database methods not yet implemented.
 - Unit tests create temp files that are not cleaned up (but they should be).
2021-05-15 23:45:30 +00:00
projectmoon 6b6e59da2e Initial SQLx implementation (variables). not yet wired up to bot.
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
- Adds migrations for the necessary tables.
 - Implements the user variables database functions.
 - Adds sqlx metadata for 'offline' use so we can build without a database.
2021-05-15 15:27:40 +00:00