-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: update crate dependencies #509
Conversation
crates/rust-client/Cargo.toml
Outdated
@@ -35,17 +35,17 @@ lazy_static = { version = "1.5", optional = true } | |||
miden-lib = { workspace = true } | |||
miden-objects = { workspace = true } | |||
miden-tx = { workspace = true } | |||
prost = { version = "0.12", optional = true, default-features = false, features = ["derive"] } | |||
prost = { version = "0.13", optional = true, default-features = false, features = ["derive"] } | |||
rand = { workspace = true } | |||
rusqlite = { version = "0.31", features = ["vtab", "array", "bundled"], optional = true } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rusqlite
version can't be updated to 0.32 as it is not compatible with the latest version (1.2) of rusqlite_migration
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it's worth maintaining rusqlite_migration
since we barely make use of its functionalities right now (basically initialize the DB schema).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with removing them. We can always re-introduce them later as needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thank you! One question: are we not able to remove lazy_static
dependency with LazyLock
or similar primitives from the standard library?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that we are missing a cargo update
+ regenerating the autogenerated files, since in the new version of Prost they removed the #[allow(clippy::derive_partial_eq_without_eq)]
.
278317c
to
685f7cf
Compare
While removing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall, but I think we should change the way the database is initialized in order to not go through all the CREATE TABLE IF NOT EXISTS
statements on every call.
One alternative is to only run store.sql
if the config database file does not exist. The other could be to have a single SQL check on the top of the file that avoids running every single statement and checking individually. I think the first one is a bit more solid since it does not require going to the DB at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Left a very minor, non-blocking comment. Feel free to disregard it!
@@ -100,9 +100,14 @@ impl SqliteStore { | |||
|
|||
/// Returns a new instance of [Store] instantiated with the specified configuration options. | |||
pub fn new(config: &SqliteStoreConfig) -> Result<Self, StoreError> { | |||
let mut db = Connection::open(config.database_filepath.clone())?; | |||
let new_database_file = !Path::new(&config.database_filepath).exists(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor nit: I think I'd name this something like database_exists
(and change the value accordingly) to make the code marginally more explicit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, you're right. Will change it!
1008e1e
to
dea1659
Compare
* chore: update dependency versions * fix: builds * chore: remove `rusqlite_migration` dependency * fix: proto field name * fix: check if database exists before intializing
* chore: update dependency versions * fix: builds * chore: remove `rusqlite_migration` dependency * fix: proto field name * fix: check if database exists before intializing
* chore: update dependency versions * fix: builds * chore: remove `rusqlite_migration` dependency * fix: proto field name * fix: check if database exists before intializing
closes #501