Skip to content

Commit

Permalink
Adds sqlite-unbundled feature (#2619)
Browse files Browse the repository at this point in the history
Adds `sqlite-unbundled` to turn on `sqlx/sqlite-unbundled`. With this
enabled, native/system sqlite will be used. Avoiding the need to build
sqlite itself. This will probably be preferred usage in most dev/ test
cycles, as most systems have a way of providing a modern sqlite3, and
compiling it is slow. Feature `embedded-db` should continue to work as
before (with sqlx bundled sqlite), so this change shouldn't disrupt
any current operations.

Co-authored-by: tbro <[email protected]>
  • Loading branch information
tbro and tbro authored Feb 17, 2025
1 parent 1830941 commit d2ec298
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 13 deletions.
43 changes: 38 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions hotshot-query-service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ default = ["file-system-data-source", "metrics-data-source", "sql-data-source"]
# Enables support for an embedded SQLite database instead of PostgreSQL.
# Ideal for lightweight nodes that benefit from pruning and merklized state storage,
# offering advantages over file system storage.
embedded-db = []
embedded-db = ["sqlx/sqlite"]

# As above, enables support for an embedded SQLite database instead of PostgreSQL.
# But uses system SQlite instead of compiling the bundled version
sqlite-unbundled = ["sqlx/sqlite-unbundled"]

# Enable the availability data source backed by the local file system.
file-system-data-source = ["atomic_store"]
Expand Down Expand Up @@ -108,7 +112,6 @@ sqlx = { version = "0.8", features = [
"bit-vec",
"postgres",
"runtime-tokio",
"sqlite",
"tls-native-tls",
], optional = true }

Expand Down
69 changes: 66 additions & 3 deletions sequencer-sqlite/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion sequencer-sqlite/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ name = "sequencer-sqlite"
version = "0.1.0"
edition = "2021"

[features]
default = ["embedded-db"]
sqlite-unbundled = ["sequencer/sqlite-unbundled"]
embedded-db = ["sequencer/embedded-db"]

[dependencies]
sequencer = { path = "../sequencer" , features = ["embedded-db"] }
sequencer = { path = "../sequencer" }
tokio = { version = "1", default-features = false, features = [
"rt-multi-thread",
"macros",
Expand Down
4 changes: 2 additions & 2 deletions sequencer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ testing = [
"hotshot-query-service/testing"
]
benchmarking = []
embedded-db = ["hotshot-query-service/embedded-db"]
embedded-db = ["hotshot-query-service/embedded-db", "sqlx/sqlite"]
sqlite-unbundled = ["hotshot-query-service/sqlite-unbundled", "sqlx/sqlite-unbundled"]
fee = []
pos = []
marketplace = []
Expand Down Expand Up @@ -109,7 +110,6 @@ sqlx = { workspace = true, features = [
"bit-vec",
"postgres",
"runtime-tokio",
"sqlite",
"tls-native-tls",
] }
static_assertions = "1"
Expand Down

0 comments on commit d2ec298

Please sign in to comment.