Skip to content
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

Merged
merged 5 commits into from
Sep 5, 2024
Merged

chore: update crate dependencies #509

merged 5 commits into from
Sep 5, 2024

Conversation

tomyrd
Copy link
Collaborator

@tomyrd tomyrd commented Aug 30, 2024

closes #501

@tomyrd tomyrd added the no changelog This PR does not require an entry in the `CHANGELOG.md` file label Aug 30, 2024
@@ -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 }
Copy link
Collaborator Author

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.

Copy link
Collaborator

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).

Copy link
Contributor

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

Copy link
Contributor

@bobbinth bobbinth left a 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?

Copy link
Collaborator

@SantiagoPittella SantiagoPittella left a 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)].

@tomyrd tomyrd force-pushed the tomyrd-update-dependencies branch from 278317c to 685f7cf Compare September 3, 2024 19:13
@tomyrd
Copy link
Collaborator Author

tomyrd commented Sep 3, 2024

are we not able to remove lazy_static dependency?

While removing rusqlite_migration I also deleted the only use of lazy_static so that dependency is no longer needed.

Copy link
Collaborator

@igamigo igamigo left a 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.

Copy link
Collaborator

@igamigo igamigo left a 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();
Copy link
Collaborator

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

Copy link
Collaborator Author

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!

@tomyrd tomyrd force-pushed the tomyrd-update-dependencies branch from 1008e1e to dea1659 Compare September 3, 2024 21:59
@tomyrd tomyrd merged commit 2f8707f into next Sep 5, 2024
13 checks passed
@tomyrd tomyrd deleted the tomyrd-update-dependencies branch September 5, 2024 12:43
SantiagoPittella pushed a commit that referenced this pull request Sep 5, 2024
* chore: update dependency versions

* fix: builds

* chore: remove `rusqlite_migration` dependency

* fix: proto field name

* fix: check if database exists before intializing
igamigo pushed a commit that referenced this pull request Nov 7, 2024
* chore: update dependency versions

* fix: builds

* chore: remove `rusqlite_migration` dependency

* fix: proto field name

* fix: check if database exists before intializing
igamigo pushed a commit that referenced this pull request Nov 7, 2024
* chore: update dependency versions

* fix: builds

* chore: remove `rusqlite_migration` dependency

* fix: proto field name

* fix: check if database exists before intializing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog This PR does not require an entry in the `CHANGELOG.md` file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants