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

Support $NNN bind parameters for sqlite #789

Merged
merged 1 commit into from
Nov 6, 2020
Merged

Support $NNN bind parameters for sqlite #789

merged 1 commit into from
Nov 6, 2020

Conversation

nitsky
Copy link
Contributor

@nitsky nitsky commented Nov 3, 2020

The sqlite driver for sqlx currently supports only the ? and ?NNN bind parameter formats. However, sqlite supports additional formats as specified here: https://sqlite.org/c3ref/bind_blob.html. With this change, I propose adding support for $NNN, which is a subset of $VVV. This will make it easier for sqlx users to write queries that are supported by both sqlite and postgres.

@nitsky nitsky changed the title support sqlite bind parameters of the form $NNN support $NNN bind parameters for sqlite Nov 3, 2020
@nitsky nitsky changed the title support $NNN bind parameters for sqlite Support $NNN bind parameters for sqlite Nov 3, 2020
@abonander
Copy link
Collaborator

abonander commented Nov 5, 2020

@nitsky I would like to at least see a test for this to make sure it works as expected. You can just go into tests/sqlite/sqlite.rs, copy an existing test and change the bind parameters.

Copy link
Collaborator

@abonander abonander left a comment

Choose a reason for hiding this comment

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

One nit plus at least a minimal test in tests/sqlite/sqlite.rs, please.

sqlx-core/src/sqlite/arguments.rs Outdated Show resolved Hide resolved
@nitsky nitsky requested a review from abonander November 5, 2020 22:28
@nitsky nitsky requested a review from abonander November 6, 2020 14:07
@abonander
Copy link
Collaborator

Excellent, thanks!

@abonander abonander merged commit 12b4250 into launchbadge:master Nov 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants