From 3ec44736b51d1f8ed7239654e1ee891e93fd7577 Mon Sep 17 00:00:00 2001 From: stephan Date: Fri, 9 Dec 2022 12:12:49 +0000 Subject: Remove some unused sqlite3_status() codes from the JS API. Add custom JS wrappers for sqlite3_create_collation/_v2() which accept JS functions (plus tests). Expand the argument options for sqlite3_wasm_db_error() to enable it to translate exception objects to C-level errors. FossilOrigin-Name: 073a2f1eb006230ae0995a5ea6c789407bcaa819ec15b5064c66d8973ed4671a --- ext/wasm/tester1.c-pp.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'ext/wasm/tester1.c-pp.js') diff --git a/ext/wasm/tester1.c-pp.js b/ext/wasm/tester1.c-pp.js index ddf60def9..1dc58983f 100644 --- a/ext/wasm/tester1.c-pp.js +++ b/ext/wasm/tester1.c-pp.js @@ -2106,6 +2106,29 @@ self.sqlite3InitModule = sqlite3InitModule; .assert(2000===list[0][1]); } })/*custom vtab #2*/ + //////////////////////////////////////////////////////////////////////// + .t('Custom collation', function(sqlite3){ + let myCmp = function(pArg,n1,p1,n2,p2){ + //int (*)(void*,int,const void*,int,const void*) + const rc = wasm.exports.sqlite3_strnicmp(p1,p2,(n1this.db.checkRc(rc), + /SQLITE_UTF8 is the only supported encoding./); + }) //////////////////////////////////////////////////////////////////////// .t('Close db', function(){ -- cgit v1.2.3