aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/sqlite3-wasm.c
Commit message (Collapse)AuthorAge
* Change wasm build's -DSQLITE_TEMP_STORE=3 to -DSQLITE_TEMP_STORE=2, ↵stephan2023-07-17
| | | | | primarily so that clients can optionally shift temp files from memory to OPFS storage. FossilOrigin-Name: 764430e804332b8f7b2f63a3c0c8acf8f6cc92534858d89de2d310938c1c0d27
* Expose the SQLITE_DBCONFIG_STMT_SCANSTATUS and ↵stephan2023-05-01
| | | | | SQLITE_DBCONFIG_REVERSE_SCANORDER sqlite3_db_config() options to JS. FossilOrigin-Name: 0a7024af3f0e1dddc1a60c67bc4084e46b297dc16fe753bd5e6a45a59fd1cfa4
* Expose the new SQLITE_VTAB_USES_ALL_SCHEMAS to JS.stephan2023-04-04
| | | FossilOrigin-Name: b7ef09be667dd349e195842304c03cbebb1693164e1c3587a5d7c96baa713edf
* Export SQLITE_FCNTL_RESET_CACHE to JS.stephan2023-03-10
| | | FossilOrigin-Name: 6195cfc86b15614b8db0e0dc5cc79b8d1acaf483f0131c8526992dc8ca075630
* Export the new SQLITE_CHANGESETAPPLY_IGNORENOOP flag to JS.stephan2023-03-08
| | | FossilOrigin-Name: ac7359b2633ead74a53b2796fe038ca285aacad45b45980db2a76a87154e66e3
* Extend wasm build to support a custom sqlite3.c to support building against ↵stephan2023-03-08
| | | | | sqlite3-see.c. The JS code now binds the SEE-specific functions if it detects an SEE build. FossilOrigin-Name: dd8612c8adbaf9d06bf0d7319b9afc9bd8ca3d0fcfa1cb591a7a2fcb86480048
* Extend wasm build to enable inclusion of client-custom C code, initialized ↵stephan2023-02-27
| | | | | via the SQLITE_EXTRA_INIT mechanism, per discussion in [forum:1e1c04f3ed1bc96b|forum post 1e1c04f3ed1bc96b]. FossilOrigin-Name: 68a52cafff60f19c9c998133d04f192b1e8b23f78b8cee13807d76845ef5e13d
* Remove the JS-side SQLITE_WASM_DEALLOC sanity check which triggers the ↵stephan2023-01-04
| | | | | problem mentioned in [688c5c13d156] and [ae0196d86ee8], for reasons covered in the code comments, per discussion in [forum:e5b20e1feb|forum post e5b20e1feb]. FossilOrigin-Name: 65ff3200c6009a1649fc108d7ce36f5c014185ba46bbf98471ec86eaeb572656
* Add some docs explaining a particular piece of [ae0196d86ee8]. No code changes.stephan2023-01-02
| | | FossilOrigin-Name: 7f96803c1cbd0633367173ab0a67a8b301b9e0746e460c50d506b536c15db0a0
* Another reformulation of SQLITE_WASM_DEALLOC to attempt to work around a ↵stephan2023-01-02
| | | | | Safari-specific quirk reported in [forum:5489305f601b8c3f|forum post 5489305f601b8c3f]. FossilOrigin-Name: ae0196d86ee8ca424b5ef5a43c32988f4ab5131ea146669bc1467e31a2384901
* An alternative solution to mapping SQLITE_WASM_DEALLOC to the proper ↵stephan2023-01-01
| | | | | function pointer in JS, to account for a Safari-specific quirk reported in [forum:e5b20e1feb|forum post e5b20e1feb]. FossilOrigin-Name: 688c5c13d156f987b895df1d5a5b770616b0d9caec4726e03ba122eb8539e7b2
* Merge trunk into wasm-session-api branch.stephan2022-12-25
|\ | | | | FossilOrigin-Name: 7f8f1acd82be7dc2eb2147d96299b1b443e86774dfe0b0a8d32669a0500fc9c6
| * Add missing sqlite3_context_db_handle() JS binding. Reimplement ↵stephan2022-12-25
| | | | | | | | | | sqlite3_set_authorizer() and sqlite3_set_auxdata() JS bindings to take advantage of [7f9ace1b11a67]. Teach FuncPtrAdapter to emit a console.warn() message if it is invoked after the library is bootstrapped, the goal being to inform users that it's an internal API and should not be invoked from client-side code. FossilOrigin-Name: 8e3d4f6294037396e388ec21abb18bf0201a6bec6ff004730cc5d11b705a6d2b
| * Replace JS-side use of SQLITE_TRANSIENT with the new SQLITE_WASM_DEALLOC, ↵stephan2022-12-24
| | | | | | | | | | reducing the amount allocation/copying required by sqlite3_bind_blob/text() and sqlite3_result_blob/text(). Remove the 'experimental' log message from the virtual table tests. FossilOrigin-Name: ffe2999a91a7dec129a38afb675fe9e539d7c347886bfea85cba55f6367d54d1
* | Merge trunk into wasm-session-api branch.stephan2022-12-23
|\| | | | | FossilOrigin-Name: f1decc831fe0dc8523956e74474d9663852b0e5b56240dd8504952726e713a97
| * Add SQLITE_ENABLE_MATH_FUNCTIONS to the list of feature flags in sqlite3-wasm.c.stephan2022-12-23
| | | | | | FossilOrigin-Name: 58503cd148c9613abfaf7c1386c34806150bd521966864ccbb821ea7dede8e5a
* | Add sqlite3.capi JS bindings for the sqlite3session_...(), ↵stephan2022-12-23
| | | | | | | | | | sqlite3changeset_...() and sqlite3changegroup_...() APIs, noting that they are completely untested. Aside from missing tests, these bindings reveal a slight string-argument-type shortcoming in the callback function pointer "reverse binding" which should ideally be resolved before publishing them. FossilOrigin-Name: 0a39172ee134816f5ce17a403b960e9c22bb56efd5bcf77ecde465efe0d88b1d
* | Initial pieces for binding the session API to JS. Far from complete. See ↵stephan2022-12-23
|/ | | | | [forum:210e36a1e3 | forum post 210e36a1e3] for the discussion. FossilOrigin-Name: cd8c100808da1043fcf63555f48f30c90272c48c6627321ceb0a0995b34733d1
* Expose a JS-friendly subset of sqlite3_config() to JS, with the notable ↵stephan2022-12-16
| | | | | caveats that (1) setting up the JS bindings requires starting the library, making sqlite3_config() illegal to call and (2) calling sqlite3_shutdown() in order to make it legal to call sqlite3_config() may undo certain JS-side library initialization. Move sqlite3_(de)serialize() into the int64-mode-only bindings because of their int64 args. FossilOrigin-Name: 62e0c931ac952219f68e22d64e20836781bf330b4581e4662266172a97c9289b
* Add sqlite3_set_authorizer() support and related tests to JS.stephan2022-12-16
| | | FossilOrigin-Name: 551b848894c249cb3c9d237643d2ed53ffcb3b003d0cf3f797a535df1731ce39
* Added a couple missing 'not part of the public API' tags on functions in ↵stephan2022-12-15
| | | | | sqlite3-wasm.c. No code changes. FossilOrigin-Name: eb27feecea508f3491a09699f2339951facd2345d479cfd3020183dc2af703b2
* Expose sqlite3_txn_state() to wasm.stephan2022-12-12
| | | FossilOrigin-Name: f6f3397a4667b15a96bdf4189c54789d622fd90351405e963d7f56ac93a9344c
* Expose a number of infrequently-used sqlite3_...() functions to wasm whose ↵stephan2022-12-12
| | | | | absences were noticed while documenting. FossilOrigin-Name: 3144e7c0b8633d99daa07d75dabfe6e115ad401110f6f3c85f768e973299f3d9
* Remove some unused sqlite3_status() codes from the JS API. Add custom JS ↵stephan2022-12-09
| | | | | 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
* Export sqlite3_status() and sqlite3_stmt_status() to wasm. Expand the ↵stephan2022-12-09
| | | | | arg/return semantics of wasm.get/setPtrValue() and get/setMemValue() to simplify handling of multiple pointers. FossilOrigin-Name: e144fd5c88fa4151429a2fef3daf389588402e158267f0afa0dfd142527d76b9
* Expose sqlite3_db_status() and sqlite3_db_config() to wasm, noting that the ↵stephan2022-12-09
| | | | | latter requires several internal wrappers to account for the various varidic forms (C varargs cannot be bound to wasm). FossilOrigin-Name: d5753668915c1db204fa80153614653243081ffaddea22f26ad59bb1836948b9
* More work on the JS vtable tests.stephan2022-12-08
| | | FossilOrigin-Name: 51e3c3b569dce2097063d39dc484f44b2f98cad0a902ef66765ca4cdc3e06f47
* More work on the JS side of the virtual table APIs.stephan2022-12-05
| | | FossilOrigin-Name: cb9881ec001b0e2faf047e57acfd1722d2b546255a54e0f850f568edfe2df1cd
* Initial infrastructure for adding virtual table/table-valued function ↵stephan2022-12-05
| | | | | support to WASM. FossilOrigin-Name: c202d7a0398b9aabc2babba5c4c91a313f32bbf37549d419775642bb4aa3936a
* Rename wasm.xWrap.resultAdapter() X:free entries to X:dealloc for ↵stephan2022-12-03
| | | | | consistency with wasm.dealloc(). Add an undocumented feature to replace wasm.alloc/dealloc/realloc() with the C-standard allocators (after an allocator misuse led down a several-hour rabbit hole trying to discover a mis-free() violation). Related test updates. FossilOrigin-Name: d9807656f8a7c2a893d3f68ee5592f44826b8e999ae66f7d9000674b5c1b0207
* JavaScript: add sqlite3.wasm.realloc(), ↵stephan2022-12-03
| | | | | sqlite3.capi.SQLITE_MAX_ALLOCATION_SIZE, and related tests. FossilOrigin-Name: eeb84ba5de1152ef0f42105b8b285fdee9f5ad58281e60a4e0c8b1d6de1dead8
* Correct the problem which triggered the rollback in [7eec635562f6]: an ↵stephan2022-12-02
| | | | | incorrect default db page size (not a multiple of 512 bytes). FossilOrigin-Name: e06e490c240aa56b616e6f0380b5d08abf06f35f9e683e5150c5ac464eae9e55
* Roll back the SQLITE_DEFAULT_PAGE_SIZE part of [c260895faacb34] because ↵stephan2022-12-02
| | | | | kvvfs does not work at all with a page size of 8kb. FossilOrigin-Name: 7eec635562f65592121d7ff0a31a7b4ff6cdfe38e657f326302ef851b3b37c3f
* sqlite3-wasm.c: code legibility and coding style tweaks. Increase ↵stephan2022-12-02
| | | | | SQLITE_DEFAULT_PAGE_SIZE from 4k to 8k, as that improves OPFS speedtest1 performance by roughly 12%. FossilOrigin-Name: c260895faacb3458c557778630756d02a8520c0f1864bddcf86cdd27ef4a42bd
* Expand JS tests for db export/import and document reason it cannot currently ↵stephan2022-12-02
| | | | | work with kvvfs. Fix a minor JS build dependencies bug. Update page title with PASS/FAIL prefix for tester1.js to improve overview when launching multiple test tabs. Add ability of tester1 should-run-test predicates to report why a given test is disabled. FossilOrigin-Name: 75f610d3a4cf3d972220f9abc27cdf5990451e3835ceb9cf66973934004dfc5c
* Add optional zSchema argument to sqlite3_js_db_export().stephan2022-11-23
| | | FossilOrigin-Name: 9c23644b1e5bf44bfb431a35fd1674c11ccb99e9eb0989f10175b0cb2a858eaa
* Remove some outdated code comments. No code changes.stephan2022-11-13
| | | FossilOrigin-Name: 80ff592a9d0157bfa8bd1f9959c3aa26cab0ec16fdccf7b58a7523b8912c1a8c
* Correct sqlite3-wasm.c's SQLITE_DEFAULT_CACHE_SIZE (it's measured in kb, not ↵stephan2022-11-04
| | | | | bytes). FossilOrigin-Name: 479ad980dfe509403e184e39a5aa441171e47b3297e05039f85516e72e9f15be
* Minor build cleanups and fix a harmless race condition in the OPFS part of ↵stephan2022-11-02
| | | | | tester1.js. FossilOrigin-Name: 70ee6ee014bc4e2c1daa9b4a8909cf76ccecf32de1eb39055f20d3d0b1daa1bd
* Add sqlite3_wasm_vfs_create_file() to replace Emscripten's ↵stephan2022-11-02
| | | | | FS.createDataFile() in a (mostly) VFS-agnostic way. Add a test for worker1's export (to bytearray) support. Re-add worker1 open-from-bytearray using sqlite3_wasm_vfs_create_file() but it's untested (requires a new interactive test app or maybe reconsideration). FossilOrigin-Name: b35e1225c91a3cadc0d25af1e4e790237256d194990faa13190e343ed03e11c5
* Minor WASM build cleanups. Enable custom Module.instantiateWasm() when not ↵stephan2022-10-30
| | | | | in WASMFS mode (where it doesn't work). Add sqlite3.debugModule URL param to enable some module-init-time debugging output. FossilOrigin-Name: 50f678846a2b3c3d0818f0bae89f2ee86252a2e6a9c7029ebaae3953ca0fa14c
* Add SQLITE_DQS to the compileoptions_used list, per request in [forum post ↵stephan2022-10-21
| | | | | 8b1060122b|forum:8b1060122b]. Force DQS=0 in sqlite3-wasm.c. FossilOrigin-Name: fcd9e0dbe3226f3f7ccc15b11fc3aa3b8058571bef274c25a33e9753e22f7551
* Add more JS tests. Flesh out the aggregate UDF tests to use ↵stephan2022-10-20
| | | | | sqlite3_aggregate_context() so that they can each be used multiple times in the same statement. Add sqlite3_js_aggregate_context() convenience helper. FossilOrigin-Name: 9d034ef5e1bab7c9651c2450dc85765fa6365d3f1414c711550de858ff8b3ece
* Rework sqlite3_wasm_vfs_unlink(), add sqlite3_wasm_db_vfs(), update some docs.stephan2022-10-20
| | | FossilOrigin-Name: cdd46858f0e63bc7bfce8e339b3db9efdec43b6443ee76563a847f53d0176831
* Considerable wasm/js build cleanups and reworking. Remove wasmfs builds from ↵stephan2022-10-19
| | | | | the end-user deliverables and disable the wasmfs build by default, per /chat discussion, as it doubles our deliverable count for only marginal gain. Attempt to move the sqlite3.js/wasm files into subdirectories but rediscovered that that breaks loading in Worker mode because URI resolution of the wasm files differs depending on whether the main script is loaded from a script tag or a Worker. FossilOrigin-Name: 5b23e0675efdd2f1ea7b4f5836a579e8d6aa8a25b3f1a6a950520ad845ff01bb
* Move the rest of testing1.js into tester1.js and eliminate the dependency on ↵stephan2022-10-13
| | | | | jaccwabyt_test.c. Extend the list of default config-related #defines in sqlite3-wasm.c and reorganize them for maintainability. FossilOrigin-Name: 4e2a8aff2dd4b6e148f45184e2523ebe47815257eca97fa3d32bcbf9625f0def
* Minor doc cleanups and corrections in sqlite3-wasm.cstephan2022-10-12
| | | FossilOrigin-Name: 5144c122a921e4240901cf4eb46347b92213273eec7cf0977952ab2b60722c27
* Refactor kvvfs JS bits to make use of [ea370b9b05f7ed7eaa]. At main-thread ↵stephan2022-10-09
| | | | | startup, if kvvfs is available, replace the kvvfs I/O methods with JS impls. Checkin part 2 of 2, to account for cherrypicking [ea370b9b05f7ed7eaa] into the kv-vfs branch. FossilOrigin-Name: a9047e020a097b2259bc9935b63ca1c538a3a7f1d050e15f0d0a08cfb84acc7c
* Minor cleanups and additions in sqlite3.capi.wasm.pstack.stephan2022-10-04
| | | FossilOrigin-Name: 97bd670d3859bd3f2e62c15065b238b85ef614f26479e56a14be42c5784aedf4
* Set default page cache size to 16mb in wasm builds. Fix an off-by-one ↵stephan2022-10-03
| | | | | counter in sqlite3_wasm_enum_json(). Minor coding style conformance tweaks. FossilOrigin-Name: 72a9e589cc318ec50941739e2edf2c0636284b316c3bf87b71fd363b37619da3