Convert to SQLx and SQLite #64

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

Replace Sled with an SQLite database that uses the SQLx library to connect to it.

Replace Sled with an SQLite database that uses the SQLx library to connect to it.
projectmoon added 1 commit 2021-05-15 15:33:37 +00:00
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
6b6e59da2e
Initial SQLx implementation (variables). not yet wired up to bot.
- 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.
projectmoon added 1 commit 2021-05-15 23:46:10 +00:00
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
cf9ce63892
Replace application-level database connectivity.
- Some database methods not yet implemented.
 - Unit tests create temp files that are not cleaned up (but they should be).
projectmoon added 1 commit 2021-05-16 14:30:05 +00:00
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
9798821b7b
Implement room and dbstate for sqlite.
projectmoon added 1 commit 2021-05-16 21:39:33 +00:00
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
bfc5609ab6
Add proper constraints to db tables. Report errors when listing users.
projectmoon added 1 commit 2021-05-16 22:25:00 +00:00
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
66fb6e7cf8
Fix various issues with room events and related logic.
- 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).
projectmoon added 1 commit 2021-05-17 23:15:15 +00:00
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
a665293268
Fix recording of room users, better logging.
- 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.
projectmoon added 1 commit 2021-05-18 14:27:26 +00:00
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
9f97a6cb43
Implement variable count; fix listing all variables returning values for all users.
projectmoon added 1 commit 2021-05-18 14:51:45 +00:00
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
e539dcac1f
Move migrations to sqlite directory. Remove in-memory temp db until refinery supports sqlx.
projectmoon added 1 commit 2021-05-18 15:17:41 +00:00
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
257f3a066c
Some user variable tests.
projectmoon added 1 commit 2021-05-18 15:37:27 +00:00
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
5e899cd962
Return key not found error if value not found for user.
projectmoon added 1 commit 2021-05-18 21:39:59 +00:00
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
d1c04b8817
Tests for all of the variables DB api.
projectmoon added 1 commit 2021-05-18 22:15:19 +00:00
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
1c4cd3d139
Add tests for rooms db API
projectmoon added 2 commits 2021-05-19 21:16:48 +00:00
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
7eee16961e
Add tests for dbstate.
projectmoon added 1 commit 2021-05-19 21:34:22 +00:00
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
a3b39ee42c
Use ON CONFLICT and transactions where appropriate.
projectmoon added 1 commit 2021-05-19 21:36:27 +00:00
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
6b6be06c89
Update sqlx offline json.
projectmoon added 1 commit 2021-05-20 15:31:17 +00:00
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
5630b4ed20
Add sled migration utility.
Author
Owner

This PR is complete as-is, and the main database has been migrated to sqlite. The next step after the dicebot is running properly on sqlite will be to do some final cleanup bits:

  • Remove Sled and related crates (zerocopy etc) completely.
  • Move the traits to the root of the db module.
  • Change config to accept a full path to a file for an sqlite database.
This PR is complete as-is, and the main database has been migrated to sqlite. The next step after the dicebot is running properly on sqlite will be to do some final cleanup bits: - Remove Sled and related crates (zerocopy etc) completely. - Move the traits to the root of the db module. - Change config to accept a full path to a file for an sqlite database.
projectmoon changed title from WIP: Convert to SQLx and SQLite to Convert to SQLx and SQLite 2021-05-20 15:34:33 +00:00
projectmoon manually merged commit 5630b4ed20 into master 2021-05-20 15:34:52 +00:00
Sign in to join this conversation.
No description provided.