-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add sqlite as a storage backend
First throw at adding sqlite as storage backend for the syncserver and the tokenserver. There is probably some duplicated code between: - syncstorage-mysql and syncstorage-sqlite - tokenserver-db-mysql and tokenserver-db-sqlite tokenserver-db-sqlite probably contains Mysql-specific SQL that might break Sqlite when ran. Squashed commit of the following: commit 1047197 Author: Eragon <[email protected]> Date: Wed Mar 6 00:24:07 2024 +0100 fix: Fix default for tokenserver-db commit 5e2a745 Author: Eragon <[email protected]> Date: Sun Feb 11 22:00:46 2024 +0100 tokenserver-db defaults to use mysql as db backend commit a587787 Author: Eragon <[email protected]> Date: Sun Feb 11 21:47:55 2024 +0100 Run cargo fmt commit c8c1458 Author: Eragon <[email protected]> Date: Sun Feb 11 20:32:19 2024 +0100 Better logging of migrations commit e2b8563 Author: Eragon <[email protected]> Date: Tue Jan 30 00:36:11 2024 +0100 wip: At least it runs now commit bd24d7c Author: Eragon <[email protected]> Date: Mon Jan 22 11:20:38 2024 +0100 lll commit 07ba38f Author: Eragon <[email protected]> Date: Fri Jan 19 14:35:20 2024 +0100 wip: First throw at adding sqlite as a storage backend
- Loading branch information
Showing
58 changed files
with
4,888 additions
and
264 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,9 +9,13 @@ members = [ | |
"syncstorage-mysql", | ||
"syncstorage-settings", | ||
"syncstorage-spanner", | ||
"syncstorage-sqlite", | ||
"tokenserver-auth", | ||
"tokenserver-common", | ||
"tokenserver-db", | ||
"tokenserver-db-common", | ||
"tokenserver-db-mysql", | ||
"tokenserver-db-sqlite", | ||
"tokenserver-settings", | ||
"syncserver", | ||
] | ||
|
@@ -23,6 +27,7 @@ authors = [ | |
"Ben Bangert <[email protected]>", | ||
"Phil Jenvey <[email protected]>", | ||
"Mozilla Services Engineering <[email protected]>", | ||
"Eragon <[email protected]>", | ||
] | ||
edition = "2021" | ||
license = "MPL-2.0" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[package] | ||
name = "syncstorage-sqlite" | ||
version.workspace=true | ||
license.workspace=true | ||
authors.workspace=true | ||
edition.workspace=true | ||
|
||
[dependencies] | ||
backtrace.workspace=true | ||
base64.workspace=true | ||
futures.workspace=true | ||
http.workspace=true | ||
slog-scope.workspace=true | ||
|
||
async-trait = "0.1.40" | ||
diesel = { version = "1.4", features = ["sqlite", "r2d2"] } | ||
diesel_logger = "0.1.1" | ||
diesel_migrations = { version = "1.4.0", features = ["sqlite"] } | ||
syncserver-common = { path = "../syncserver-common" } | ||
syncserver-db-common = { path = "../syncserver-db-common" } | ||
syncstorage-db-common = { path = "../syncstorage-db-common" } | ||
syncstorage-settings = { path = "../syncstorage-settings" } | ||
thiserror = "1.0.26" | ||
url = "2.1" | ||
|
||
[dev-dependencies] | ||
env_logger.workspace=true | ||
syncserver-settings = { path = "../syncserver-settings" } |
8 changes: 8 additions & 0 deletions
8
syncstorage-sqlite/migrations/2024-01-19-131212_Init/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
-- DROP INDEX IF EXISTS `bso_expiry_idx`; | ||
-- DROP INDEX IF EXISTS `bso_usr_col_mod_idx`; | ||
|
||
-- DROP TABLE IF EXISTS `bso`; | ||
-- DROP TABLE IF EXISTS `collections`; | ||
-- DROP TABLE IF EXISTS `user_collections`; | ||
-- DROP TABLE IF EXISTS `batch_uploads`; | ||
-- DROP TABLE IF EXISTS `batch_upload_items`; |
Oops, something went wrong.