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

Added regexp support in sqlite #2189

Merged
merged 5 commits into from
Feb 14, 2023

Conversation

VictorKoenders
Copy link
Contributor

@VictorKoenders VictorKoenders commented Nov 4, 2022

Closes #194

For a project I ended up implementing a custom REGEXP implementation for sqlite. I noticed sqlx did not have that, and #194 mentioned that it was not implemented yet.

This is technically a breaking change if a user has already defined their own REGEXP function. but sqlite's behavior is to simply overwrite the previous function, and sqlx did not have a regex feature yet (only in sqlx-core).

The current implementation is very strict. It only accepts UTF-8 columns in both the field and the REGEXP. In my system this has not been an issue.

I'm unsure where to add documentation on this, I'm guessing in the sqlite documentation?

I also took the liberty of bumping libsqlite3-sys

@abonander abonander changed the base branch from main to 0.7-dev February 8, 2023 18:56
@abonander
Copy link
Collaborator

@VictorKoenders base changed to 0.7-dev, do you mind rebasing?

Also, can we have a flag in SqliteConnectOptions that enables the injection of this function? That way it's not a breaking change.

@abonander abonander merged commit e52bcd8 into launchbadge:0.7-dev Feb 14, 2023
grgi pushed a commit to faccts/sqlx that referenced this pull request Feb 14, 2023
* CHANGELOG: mention that users should upgrade CLI

* Added regexp support in sqlite

* Added a with_regexp function to sqliteconnectoptions

* Fixed tests

* Undo CHANGELOG.md change

---------

Co-authored-by: Austin Bonander <[email protected]>
Co-authored-by: Victor Koenders <[email protected]>
abonander added a commit that referenced this pull request Feb 18, 2023
* CHANGELOG: mention that users should upgrade CLI

* Added regexp support in sqlite

* Added a with_regexp function to sqliteconnectoptions

* Fixed tests

* Undo CHANGELOG.md change

---------

Co-authored-by: Austin Bonander <[email protected]>
Co-authored-by: Victor Koenders <[email protected]>
abonander added a commit that referenced this pull request Feb 21, 2023
* CHANGELOG: mention that users should upgrade CLI

* Added regexp support in sqlite

* Added a with_regexp function to sqliteconnectoptions

* Fixed tests

* Undo CHANGELOG.md change

---------

Co-authored-by: Austin Bonander <[email protected]>
Co-authored-by: Victor Koenders <[email protected]>
Aandreba pushed a commit to Aandreba/sqlx that referenced this pull request Mar 31, 2023
* CHANGELOG: mention that users should upgrade CLI

* Added regexp support in sqlite

* Added a with_regexp function to sqliteconnectoptions

* Fixed tests

* Undo CHANGELOG.md change

---------

Co-authored-by: Austin Bonander <[email protected]>
Co-authored-by: Victor Koenders <[email protected]>
@Vzz1c
Copy link

Vzz1c commented May 7, 2023

I can only use SqliteConnectOptions, not SqlitePoolOptions, so how do I use pool?

@dacz
Copy link

dacz commented Jun 16, 2023

Please, is there any ETA of having regexp in release? Or any other way how regexp can be enabled before?
Thanks a lot.

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.

[SQLite] Provide REGEXP behind the regex feature
4 participants