stephan [Mon, 7 Aug 2023 11:18:44 +0000 (11:18 +0000)]
When converting a Java exception to a db error message, use Throwable.toString() instead of getMessage() so that the exception type's name is included. More internal API renaming for consistency.
stephan [Sun, 6 Aug 2023 22:09:09 +0000 (22:09 +0000)]
Rework the sqlite3_open(_v2)() order of operations so that pending auto-extension support can get ahold of the open-time Java state despite the Java/C (sqlite3*) binding not having yet been established.
stephan [Sun, 6 Aug 2023 21:29:13 +0000 (21:29 +0000)]
Completely rework how the JNI sqlite3_open(_v2) and sqlite3_prepare(_vN)() bindings deal with output pointers to give the JNI side full control over the origin of db and stmt handles (necessary for solving chicken/egg situations in auto-extensions and prepare-time trace). Lots of adjacent internal API renaming.
stephan [Sun, 6 Aug 2023 20:01:30 +0000 (20:01 +0000)]
Start adding JNI-side support for auto extensions, but hit a brick wall which requires slightly awkward semantics changes in the JNI bindings for sqlite3_open(_v2)() to resolve, so stash this #if'd out for the time being.
stephan [Sun, 6 Aug 2023 11:05:17 +0000 (11:05 +0000)]
Remove doc outdated warning about sqlite3_trace_v2() JNI binding being incompatible with MUTF-8. Use new to-string capability to simplify Fts5ExtensionApi::xColumnText() JNI binding.
stephan [Sun, 6 Aug 2023 10:14:53 +0000 (10:14 +0000)]
Bind sqlite3_db_filename() and (closely related) (A) add many more docs about the UTF-8/MUTF-8 discrepancy (B) start adding internals to enable us to perform the standard-UTF-8-to-Java conversion from C.
stephan [Sat, 5 Aug 2023 21:35:58 +0000 (21:35 +0000)]
Refactor the per-JNIEnv cache from a fixed-size static array to a linked list of dynamically-allocated entries. Uncache all per-db state (which is necessarily JNIEnv-specific) when the corresponding JNIEnv is uncached.
stephan [Sat, 5 Aug 2023 20:19:45 +0000 (20:19 +0000)]
Add SQLite3Jni.uncacheJniEnv(), a way for Java threads to clear their thread-specific cached state from the JNI bindings when they're about to terminate (or are otherwise done using the library).
stephan [Sat, 5 Aug 2023 11:16:54 +0000 (11:16 +0000)]
Bind Fts5ExtensionApi::xUserData() to JNI and extend xCreateFunction() to accept that argument. In test code, use assert() instead of exceptions if assert() is enabled so that test failures (exceptions) thrown via callbacks do not get suppressed (which they otherwise necessarily are to avoid crashing the host app).
stephan [Sat, 5 Aug 2023 00:40:28 +0000 (00:40 +0000)]
Bind the remaining Fts5ExtensionApi methods to JNI, noting that all are completely untested because the higher-level bits needed to do so are still missing.
stephan [Mon, 31 Jul 2023 13:52:46 +0000 (13:52 +0000)]
Experimentally change the JNI sqlite3_trace_v2() callback type to have more convenient access to the current Java-side sqlite3_stmt at the cost of some uncomfortably fiddly current-statement tracking in the JNI layer. Subject to change.
stephan [Mon, 31 Jul 2023 12:10:32 +0000 (12:10 +0000)]
Add some JNI-internal metrics, accessible via passing -v when running Tester1.java. Document an OpenJDK bug which leads to incorrect -Xlint:jni warnings.
stephan [Mon, 31 Jul 2023 10:55:30 +0000 (10:55 +0000)]
Correct a mis-cast in the JNI wrapper which just happened to accidentally work. Update JNI binding of sqlite3_context_db_handle() to return the bound-at-open() db instance instead of a new/temp proxy object.
stephan [Sun, 30 Jul 2023 10:47:38 +0000 (10:47 +0000)]
Internal JNI refacoring to support the pending sqlite3_collation_needed() callback. Correct a bug in the linked-list handling of PerDbStateJni which triggered an assert().
stephan [Fri, 28 Jul 2023 09:25:05 +0000 (09:25 +0000)]
More Java docs about making use of the aggregate context. Change the JNI mapping to set the sqlite3_context::aggregateContext member directly, instead of via a superflous setter, because that way is faster.
stephan [Fri, 28 Jul 2023 01:51:14 +0000 (01:51 +0000)]
More docs and cleanups related to the aggregate UDF state. Correct the OOM check to behave properly if xFinal() is called without a matching xStep(), xValue(), or xInverse().
Change the debugging "json_parse(X)" function so that it shows a more
complete description of the JsonParse object on standard output and returns
the mimified JSON. Former behavior was to return the text of a decode
of the aNode array.
stephan [Wed, 26 Jul 2023 11:41:41 +0000 (11:41 +0000)]
Remove the batch SQL runner from the JS build's 'all' target, as it's long-since unused and adds noticable build time. Add makefile comments about JSPI.
stephan [Wed, 26 Jul 2023 11:11:39 +0000 (11:11 +0000)]
Add SAHPoolUtil.getFileNames() method, and tests for it, per [forum:a3da1e34d8|forum feedback]. Add a test to demonstrate that two SAH pools can coexist so long as they have different names.
Add the concept of an RCStr string - a "Reference Counted String". Use
these to keep track of big JSON strings that might need to be used in
multiple places at the same time with different lifetimes. Add two
different JSON string values to each parse - one with and one without
changes. The net result is a large reduction in the number of parses
that occur when doing an UPDATE of a indexed JSON field using
json_replace() or similar.
Add the JsonParse.zAlt field to old revised JSON text after a change.
Demonstrate that this elminates the need for reparsing after a change
by using it in the json_remove() function. This is an incremental check-in
containing lots of cruft.