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

Add REGEXP support #55

Closed
Rastanislav opened this issue Mar 7, 2018 · 5 comments
Closed

Add REGEXP support #55

Rastanislav opened this issue Mar 7, 2018 · 5 comments

Comments

@Rastanislav
Copy link

Hello, is it possible to add the regexp() support out of the box?
Or if there is a way to add it from other source please provide some info.
SQLITE_ERROR: no such function: regexp

Thanks

@theogravity
Copy link
Collaborator

Can you give an example of how it should be used / defined in the library?

@KamilaBorowska
Copy link

KamilaBorowska commented Jan 9, 2019

It's necessary to define a function called regexp, see https://www.sqlite.org/c3ref/create_function.html, taking two arguments, the first one being regular expression, the second one being text to match. See TryGhost/node-sqlite3#140 and TryGhost/node-sqlite3#448.

@antoni-g
Copy link

antoni-g commented Mar 25, 2019

If I'm not mistaken, this issue references this in the original mapbox implementation:

storesafe/cordova-sqlite-storage#741

To tl;dr, user defined functions are allowed in the SQLite specifications, but they are not implemented in the original node.js implementation. I don't think the pull request to add the functionality has been approved on the master branch, which is found here: TryGhost/node-sqlite3#448

@theogravity
Copy link
Collaborator

theogravity commented Mar 22, 2020

This is a non-native extension and wouldn't be supported out the box, but the v4 beta has the loadExtension method from sqlite3 that you might want to check out.

@lixingyangok
Copy link

loadExtension

Is there usage for loadExtension() please?
I am trying to make the sqlite3 can use regexp,
but I haven't found the information of loadExtension in Document 😂😂😂
Thanks a lot, 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

No branches or pull requests

5 participants