-
Notifications
You must be signed in to change notification settings - Fork 10
Enable Sqlite support by updating the SQLx dependency. #18
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
base: latest
Are you sure you want to change the base?
Conversation
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.
Summary of Changes
Hello @felixwatts, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request primarily focuses on enabling full Sqlite support within the project by performing a significant upgrade of the sqlx
database driver dependency. This change addresses a fundamental compatibility issue that previously prevented Sqlite from functioning correctly, making the project more versatile in its database connectivity options.
Highlights
- Dependency Upgrade: Upgraded the
sqlx
crate dependency from version0.5
to0.8.6
. This critical update enables proper Sqlite support by resolving issues whereSqliteConnections
were notSend
, which was preventing Sqlite from being used with thetide-sqlx
middleware. - Example Code Fix: Updated an example snippet within
src/lib.rs
to align with a breaking change in thesqlx
API. Specifically, thelog_statements
method onPgConnectOptions
now returnsSelf
for chaining, requiring the assignmentlet mut connect_opts = connect_opts.log_statements(...)
to ensure the example remains compilable and correct with the newsqlx
version.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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.
Code Review
This pull request updates the sqlx
dependency to a newer version to enable SQLite support. This is a good goal, but the version bump is a major one and introduces breaking changes that are not fully addressed.
I've left a critical comment on Cargo.toml
regarding a breaking API change in sqlx
that will prevent this library from compiling. I've also left a medium severity suggestion in a doc-test to improve code style.
Please address the breaking change to ensure the library remains buildable after this update.
[dependencies] | ||
async-std = "1" | ||
sqlx = "0.5" | ||
sqlx = "0.8.6" |
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.
Updating sqlx
from 0.5
to 0.8.6
is a major version bump. This likely introduces significant breaking changes to the sqlx
API that are not fully addressed in this pull request, potentially leading to build failures or runtime issues. Please ensure all necessary code adaptations for the new sqlx
version are included.
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.
The code builds and the tests pass.
src/lib.rs
Outdated
//! let mut connect_opts = PgConnectOptions::new(); | ||
//! connect_opts.log_statements(LevelFilter::Debug); | ||
//! let mut connect_opts = connect_opts.log_statements(LevelFilter::Debug); |
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.
While this change is correct for the new sqlx
API, it can be made more idiomatic and concise by chaining the builder methods. This also allows removing the mut
keyword, as connect_opts
is moved into .connect_with()
on line 53 and doesn't need to be mutable.
//! let mut connect_opts = PgConnectOptions::new(); | |
//! connect_opts.log_statements(LevelFilter::Debug); | |
//! let mut connect_opts = connect_opts.log_statements(LevelFilter::Debug); | |
//! let connect_opts = PgConnectOptions::new() | |
//! .log_statements(LevelFilter::Debug); |
Currently Sqlite doesn't work:
However, by updating the SQLx package dependency from 0.5.4 to 0.8.6, the code above compiles and works.