Skip to content

Commit bfb84e0

Browse files
author
Paul Bergeron
committed
Update readme to match new custom function behavior.
Adding @dinedal to AUTHORS as requested.
1 parent 400b3a1 commit bfb84e0

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

AUTHORS

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ Ophir LOJKINE <[email protected]> (https://github.com/lovasoa)
22
@kripken
33
@hankinsoft
44
@firien
5-
5+
@dinedal

README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,11 @@ while (stmt.step()) console.log(stmt.get()); // Will print [0, 'hello']
4848

4949
// You can also use javascript functions inside your SQL code
5050
// Create the js function you need
51-
// (Custom function can only return null, a string, or a number)
5251
function add(a, b) {return a+b;}
5352
// Specifies the SQL function's name, the number of it's arguments, and the js function to use
54-
db.create_function("add_js", 2, add);
53+
db.create_function("add_js", add);
5554
// Run a query in which the function is used
56-
db.run("INSERT INTO hello VALUES (add_js(7, 3), add_js('Hello ', 'world'));");
55+
db.run("INSERT INTO hello VALUES (add_js(7, 3), add_js('Hello ', 'world'));"); // Inserts 10 and 'Hello world'
5756

5857
// free the memory used by the statement
5958
stmt.free();

0 commit comments

Comments
 (0)