-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
sqlite: add support for custom functions #55985
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #55985 +/- ##
==========================================
- Coverage 88.54% 88.53% -0.01%
==========================================
Files 657 657
Lines 189970 190149 +179
Branches 36482 36516 +34
==========================================
+ Hits 168200 168348 +148
- Misses 14979 14986 +7
- Partials 6791 6815 +24
|
@@ -132,6 +132,31 @@ This method allows one or more SQL statements to be executed without returning | |||
any results. This method is useful when executing SQL statements read from a | |||
file. This method is a wrapper around [`sqlite3_exec()`][]. | |||
|
|||
### `database.function(name[, options], function)` |
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.
Two questions:
- Why isn't the optional parameter the last one?
- Why not call it
createFunction
? I think that makes the method more self-explanatory.
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 boring answer to both questions is "because that's how better-sqlite3 does it."
This commit adds support to node:sqlite for defining custom functions that can be invoked from SQL. Fixes: nodejs#54349
9909463
to
e0435f0
Compare
Landed in e5524ea |
This commit adds support to node:sqlite for defining custom functions that can be invoked from SQL.
Fixes: #54349