aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/sqlite3-api-oo1.js
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2022-10-13 16:48:35 +0000
committerstephan <stephan@noemail.net>2022-10-13 16:48:35 +0000
commitd92c652ac1fe570e27acd83e15903fb695386880 (patch)
tree18fa59ddc4e4960babfdbdf048193486691abba5 /ext/wasm/api/sqlite3-api-oo1.js
parent921acff92767b6dcda8ed2134c73497fe33905c6 (diff)
downloadsqlite-d92c652ac1fe570e27acd83e15903fb695386880.tar.gz
sqlite-d92c652ac1fe570e27acd83e15903fb695386880.zip
Move the rest of testing1.js into tester1.js and eliminate the dependency on jaccwabyt_test.c. Extend the list of default config-related #defines in sqlite3-wasm.c and reorganize them for maintainability.
FossilOrigin-Name: 4e2a8aff2dd4b6e148f45184e2523ebe47815257eca97fa3d32bcbf9625f0def
Diffstat (limited to 'ext/wasm/api/sqlite3-api-oo1.js')
-rw-r--r--ext/wasm/api/sqlite3-api-oo1.js22
1 files changed, 15 insertions, 7 deletions
diff --git a/ext/wasm/api/sqlite3-api-oo1.js b/ext/wasm/api/sqlite3-api-oo1.js
index b78c9b68e..fa6c6d8e5 100644
--- a/ext/wasm/api/sqlite3-api-oo1.js
+++ b/ext/wasm/api/sqlite3-api-oo1.js
@@ -806,12 +806,16 @@ self.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
- (optionsObject)
In the final two cases, the function must be defined as the
- 'callback' property of the options object. In the final
+ `callback` property of the options object (optionally called
+ `xFunc` to align with the C API documentation). In the final
case, the function's name must be the 'name' property.
- This can only be used to create scalar functions, not
- aggregate or window functions. UDFs cannot be removed from
- a DB handle after they're added.
+ This can currently only be used to create scalar functions, not
+ aggregate or window functions (requires only a bit of
+ refactoring to support aggregates and window functions).
+
+ UDFs cannot currently be removed from a DB handle after they're
+ added.
On success, returns this object. Throws on error.
@@ -848,18 +852,22 @@ self.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
- .deterministic = SQLITE_DETERMINISTIC
- .directOnly = SQLITE_DIRECTONLY
- .innocuous = SQLITE_INNOCUOUS
+
+ TODO: for the (optionsObject) form, accept callbacks for
+ aggregate and window functions.
+
*/
- createFunction: function f(name, callback,opt){
+ createFunction: function f(name, callback, opt){
switch(arguments.length){
case 1: /* (optionsObject) */
opt = name;
name = opt.name;
- callback = opt.callback;
+ callback = opt.xFunc || opt.callback;
break;
case 2: /* (name, callback|optionsObject) */
if(!(callback instanceof Function)){
opt = callback;
- callback = opt.callback;
+ callback = opt.xFunc || opt.callback;
}
break;
default: break;