flatsql 1.4.4 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,190 +1,131 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to the Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS
177
-
178
- Copyright 2025 Digital Arsenal, Inc.
179
-
180
- Licensed under the Apache License, Version 2.0 (the "License");
181
- you may not use this file except in compliance with the License.
182
- You may obtain a copy of the License at
183
-
184
- http://www.apache.org/licenses/LICENSE-2.0
185
-
186
- Unless required by applicable law or agreed to in writing, software
187
- distributed under the License is distributed on an "AS IS" BASIS,
188
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
- See the License for the specific language governing permissions and
190
- limitations under the License.
1
+ # PolyForm Noncommercial License 1.0.0
2
+
3
+ <https://polyformproject.org/licenses/noncommercial/1.0.0>
4
+
5
+ ## Acceptance
6
+
7
+ In order to get any license under these terms, you must agree
8
+ to them as both strict obligations and conditions to all
9
+ your licenses.
10
+
11
+ ## Copyright License
12
+
13
+ The licensor grants you a copyright license for the
14
+ software to do everything you might do with the software
15
+ that would otherwise infringe the licensor's copyright
16
+ in it for any permitted purpose. However, you may
17
+ only distribute the software according to [Distribution
18
+ License](#distribution-license) and make changes or new works
19
+ based on the software according to [Changes and New Works
20
+ License](#changes-and-new-works-license).
21
+
22
+ ## Distribution License
23
+
24
+ The licensor grants you an additional copyright license
25
+ to distribute copies of the software. Your license
26
+ to distribute covers distributing the software with
27
+ changes and new works permitted by [Changes and New Works
28
+ License](#changes-and-new-works-license).
29
+
30
+ ## Notices
31
+
32
+ You must ensure that anyone who gets a copy of any part of
33
+ the software from you also gets a copy of these terms or the
34
+ URL for them above, as well as copies of any plain-text lines
35
+ beginning with `Required Notice:` that the licensor provided
36
+ with the software. For example:
37
+
38
+ > Required Notice: Copyright DigitalArsenal.io, Inc.
39
+
40
+ ## Changes and New Works License
41
+
42
+ The licensor grants you an additional copyright license to
43
+ make changes and new works based on the software for any
44
+ permitted purpose.
45
+
46
+ ## Patent License
47
+
48
+ The licensor grants you a patent license for the software that
49
+ covers patent claims the licensor can license, or becomes able
50
+ to license, that you would infringe by using the software.
51
+
52
+ ## Noncommercial Purposes
53
+
54
+ Any noncommercial purpose is a permitted purpose.
55
+
56
+ ## Personal Uses
57
+
58
+ Personal use for research, experiment, and testing for
59
+ the benefit of public knowledge, personal study, private
60
+ entertainment, hobby projects, amateur pursuits, or religious
61
+ observance, without any anticipated commercial application,
62
+ is use for a permitted purpose.
63
+
64
+ ## Noncommercial Organizations
65
+
66
+ Use by any charitable organization, educational institution,
67
+ public research organization, public safety or health
68
+ organization, environmental protection organization,
69
+ or government institution is use for a permitted purpose
70
+ regardless of the source of funding or obligations resulting
71
+ from the funding.
72
+
73
+ ## Fair Use
74
+
75
+ You may have "fair use" rights for the software under the
76
+ law. These terms do not limit them.
77
+
78
+ ## No Other Rights
79
+
80
+ These terms do not allow you to sublicense or transfer any of
81
+ your licenses to anyone else, or prevent the licensor from
82
+ granting licenses to anyone else. These terms do not imply
83
+ any other licenses.
84
+
85
+ ## Patent Defense
86
+
87
+ If you make any written claim that the software infringes or
88
+ contributes to infringement of any patent, your patent license
89
+ for the software granted under these terms ends immediately. If
90
+ your company makes such a claim, your patent license ends
91
+ immediately for work on behalf of your company.
92
+
93
+ ## Violations
94
+
95
+ The first time you are notified in writing that you have
96
+ violated any of these terms, or done anything with the software
97
+ not covered by your licenses, your licenses can nonetheless
98
+ continue if you come into full compliance with these terms,
99
+ and take practical steps to correct past violations, within
100
+ 32 days of receiving notice. Otherwise, all your licenses
101
+ end immediately.
102
+
103
+ ## No Liability
104
+
105
+ ***As far as the law allows, the software comes as is, without
106
+ any warranty or condition, and the licensor will not be liable
107
+ to you for any damages arising out of these terms or the use
108
+ or nature of the software, under any kind of legal claim.***
109
+
110
+ ## Definitions
111
+
112
+ The **licensor** is the individual or entity offering these
113
+ terms, and the **software** is the software the licensor makes
114
+ available under these terms.
115
+
116
+ **You** refers to the individual or entity agreeing to these
117
+ terms.
118
+
119
+ **Your company** is any legal entity, sole proprietorship,
120
+ or other kind of organization that you work for, plus all
121
+ organizations that have control over, are under the control of,
122
+ or are under common control with that organization. **Control**
123
+ means ownership of substantially all the assets of an entity,
124
+ or the power to direct its management and policies by vote,
125
+ contract, or otherwise. Control can be direct or indirect.
126
+
127
+ **Your licenses** are all the licenses granted to you for the
128
+ software under these terms.
129
+
130
+ **Use** means anything you do with the software requiring one
131
+ of your licenses.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![CI](https://github.com/DigitalArsenal/flatsql/actions/workflows/ci.yml/badge.svg)](https://github.com/DigitalArsenal/flatsql/actions/workflows/ci.yml)
4
4
  [![npm version](https://img.shields.io/npm/v/flatsql.svg)](https://www.npmjs.com/package/flatsql)
5
- [![License](https://img.shields.io/badge/License-Apache%202.0-green.svg)](https://opensource.org/licenses/Apache-2.0)
5
+ [![License](https://img.shields.io/badge/License-PolyForm%20Noncommercial%201.0.0-blue.svg)](https://polyformproject.org/licenses/noncommercial/1.0.0/)
6
6
 
7
7
  **SQL queries over raw FlatBuffer storage** — A streaming query engine that keeps data in native FlatBuffer format while providing SQL access via SQLite virtual tables.
8
8
 
@@ -755,7 +755,7 @@ SELECT * FROM User WHERE _source = 'satellite-1';
755
755
 
756
756
  ## License
757
757
 
758
- Apache 2.0
758
+ [PolyForm Noncommercial License 1.0.0](https://polyformproject.org/licenses/noncommercial/1.0.0/) — source-available, free for any noncommercial purpose. Commercial use requires a separate license from DigitalArsenal.io, Inc. See [LICENSE](LICENSE).
759
759
 
760
760
  ## Contributing
761
761
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flatsql",
3
- "version": "1.4.4",
3
+ "version": "2.0.0",
4
4
  "description": "SQL queries over raw FlatBuffer storage - zero conversion, real-time indexing, pure streaming",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -76,10 +76,11 @@
76
76
  "dev": "tsc --watch",
77
77
  "serve": "vite docs --port 8081",
78
78
  "check:nav": "node scripts/check-sdn-stack-nav.mjs flatsql docs/index.html",
79
+ "check:dist": "node scripts/check-dist-tracked.mjs",
79
80
  "bench": "node bench/flatsql-perf.mjs",
80
81
  "bench:perf": "node bench/flatsql-perf.mjs",
81
82
  "bench:perf:profile": "node bench/flatsql-perf.mjs --profile",
82
- "prepublishOnly": "npm run build && npm run test:wasi && npm run test:wasmedge && npm test -- --runInBand --runTestsByPath test/package-exports.test.ts test/wasm-generic-extractor.test.ts test/wasm-pointer.test.ts",
83
+ "prepublishOnly": "npm run build && npm run check:dist && npm run test:wasi && npm run test:wasmedge && npm test -- --runInBand --runTestsByPath test/package-exports.test.ts test/wasm-generic-extractor.test.ts test/wasm-pointer.test.ts",
83
84
  "emsdk:install": "bash scripts/install-emsdk.sh",
84
85
  "emsdk:env": "echo 'Run: source packages/emsdk/emsdk_env.sh'",
85
86
  "test:wasi": "node --experimental-wasm-exnref --experimental-vm-modules node_modules/jest/bin/jest.js --runTestsByPath test/wasi.test.ts test/standalone-wasm-imports.test.ts",
@@ -122,7 +123,7 @@
122
123
  "space-data-module"
123
124
  ],
124
125
  "author": "Digital Arsenal <tj@digitalarsenal.io>",
125
- "license": "Apache-2.0",
126
+ "license": "PolyForm-Noncommercial-1.0.0",
126
127
  "dependencies": {
127
128
  "flatbuffers": "^25.9.23",
128
129
  "flatc-wasm": "^26.1.32",
Binary file
Binary file
package/wasm/flatsql.js CHANGED
@@ -1,2 +1,2 @@
1
- async function FlatSQL(moduleArg={}){var moduleRtn;var Module=moduleArg;var ENVIRONMENT_IS_WEB=!!globalThis.window;var ENVIRONMENT_IS_WORKER=!!globalThis.WorkerGlobalScope;var ENVIRONMENT_IS_NODE=globalThis.process?.versions?.node&&globalThis.process?.type!="renderer";if(ENVIRONMENT_IS_NODE){const{createRequire}=await import("module");var require=createRequire(import.meta.url)}var arguments_=[];var thisProgram="./this.program";var quit_=(status,toThrow)=>{throw toThrow};var _scriptName=import.meta.url;var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require("fs");if(_scriptName.startsWith("file:")){scriptDirectory=require("path").dirname(require("url").fileURLToPath(_scriptName))+"/"}readBinary=filename=>{filename=isFileURI(filename)?new URL(filename):filename;var ret=fs.readFileSync(filename);return ret};readAsync=async(filename,binary=true)=>{filename=isFileURI(filename)?new URL(filename):filename;var ret=fs.readFileSync(filename,binary?undefined:"utf8");return ret};if(process.argv.length>1){thisProgram=process.argv[1].replace(/\\/g,"/")}arguments_=process.argv.slice(2);quit_=(status,toThrow)=>{process.exitCode=status;throw toThrow}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){try{scriptDirectory=new URL(".",_scriptName).href}catch{}{if(ENVIRONMENT_IS_WORKER){readBinary=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=async url=>{var response=await fetch(url,{credentials:"same-origin"});if(response.ok){return response.arrayBuffer()}throw new Error(response.status+" : "+response.url)}}}else{}var out=console.log.bind(console);var err=console.error.bind(console);var wasmBinary;var ABORT=false;var isFileURI=filename=>filename.startsWith("file://");var readyPromiseResolve,readyPromiseReject;var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;var HEAP64,HEAPU64;var runtimeInitialized=false;function updateMemoryViews(){var b=wasmMemory.buffer;HEAP8=new Int8Array(b);HEAP16=new Int16Array(b);Module["HEAPU8"]=HEAPU8=new Uint8Array(b);HEAPU16=new Uint16Array(b);HEAP32=new Int32Array(b);HEAPU32=new Uint32Array(b);HEAPF32=new Float32Array(b);HEAPF64=new Float64Array(b);HEAP64=new BigInt64Array(b);HEAPU64=new BigUint64Array(b)}function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(onPreRuns)}function initRuntime(){runtimeInitialized=true;wasmExports["Na"]()}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(onPostRuns)}function abort(what){Module["onAbort"]?.(what);what="Aborted("+what+")";err(what);ABORT=true;what+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(what);readyPromiseReject?.(e);throw e}var wasmBinaryFile;function findWasmBinary(){if(Module["locateFile"]){return locateFile("flatsql.wasm")}return new URL("flatsql.wasm",import.meta.url).href}function getBinarySync(file){if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}throw"both async and sync fetching of the wasm failed"}async function getWasmBinary(binaryFile){if(!wasmBinary){try{var response=await readAsync(binaryFile);return new Uint8Array(response)}catch{}}return getBinarySync(binaryFile)}async function instantiateArrayBuffer(binaryFile,imports){try{var binary=await getWasmBinary(binaryFile);var instance=await WebAssembly.instantiate(binary,imports);return instance}catch(reason){err(`failed to asynchronously prepare wasm: ${reason}`);abort(reason)}}async function instantiateAsync(binary,binaryFile,imports){if(!binary&&!ENVIRONMENT_IS_NODE){try{var response=fetch(binaryFile,{credentials:"same-origin"});var instantiationResult=await WebAssembly.instantiateStreaming(response,imports);return instantiationResult}catch(reason){err(`wasm streaming compile failed: ${reason}`);err("falling back to ArrayBuffer instantiation")}}return instantiateArrayBuffer(binaryFile,imports)}function getWasmImports(){var imports={a:wasmImports};return imports}async function createWasm(){function receiveInstance(instance,module){wasmExports=instance.exports;wasmExports=applySignatureConversions(wasmExports);assignWasmExports(wasmExports);updateMemoryViews();return wasmExports}function receiveInstantiationResult(result){return receiveInstance(result["instance"])}var info=getWasmImports();if(Module["instantiateWasm"]){return new Promise((resolve,reject)=>{Module["instantiateWasm"](info,(inst,mod)=>{resolve(receiveInstance(inst,mod))})})}wasmBinaryFile??=findWasmBinary();var result=await instantiateAsync(wasmBinary,wasmBinaryFile,info);var exports=receiveInstantiationResult(result);return exports}class ExitStatus{name="ExitStatus";constructor(status){this.message=`Program terminated with exit(${status})`;this.status=status}}var callRuntimeCallbacks=callbacks=>{while(callbacks.length>0){callbacks.shift()(Module)}};var onPostRuns=[];var addOnPostRun=cb=>onPostRuns.push(cb);var onPreRuns=[];var addOnPreRun=cb=>onPreRuns.push(cb);var noExitRuntime=true;var stackRestore=val=>__emscripten_stack_restore(val);var stackSave=()=>_emscripten_stack_get_current();var exceptionCaught=[];var uncaughtExceptionCount=0;var INT53_MAX=9007199254740992;var INT53_MIN=-9007199254740992;var bigintToI53Checked=num=>num<INT53_MIN||num>INT53_MAX?NaN:Number(num);function ___cxa_begin_catch(ptr){ptr>>>=0;var info=new ExceptionInfo(ptr);if(!info.get_caught()){info.set_caught(true);uncaughtExceptionCount--}info.set_rethrown(false);exceptionCaught.push(info);return ___cxa_get_exception_ptr(ptr)}var exceptionLast=0;var ___cxa_end_catch=()=>{_setThrew(0,0);var info=exceptionCaught.pop();___cxa_decrement_exception_refcount(info.excPtr);exceptionLast=0};class ExceptionInfo{constructor(excPtr){this.excPtr=excPtr;this.ptr=excPtr-24}set_type(type){HEAPU32[this.ptr+4>>>2>>>0]=type}get_type(){return HEAPU32[this.ptr+4>>>2>>>0]}set_destructor(destructor){HEAPU32[this.ptr+8>>>2>>>0]=destructor}get_destructor(){return HEAPU32[this.ptr+8>>>2>>>0]}set_caught(caught){caught=caught?1:0;HEAP8[this.ptr+12>>>0]=caught}get_caught(){return HEAP8[this.ptr+12>>>0]!=0}set_rethrown(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+13>>>0]=rethrown}get_rethrown(){return HEAP8[this.ptr+13>>>0]!=0}init(type,destructor){this.set_adjusted_ptr(0);this.set_type(type);this.set_destructor(destructor)}set_adjusted_ptr(adjustedPtr){HEAPU32[this.ptr+16>>>2>>>0]=adjustedPtr}get_adjusted_ptr(){return HEAPU32[this.ptr+16>>>2>>>0]}}var setTempRet0=val=>__emscripten_tempret_set(val);var findMatchingCatch=args=>{var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0}var info=new ExceptionInfo(thrown);info.set_adjusted_ptr(thrown);var thrownType=info.get_type();if(!thrownType){setTempRet0(0);return thrown}for(var caughtType of args){if(caughtType===0||caughtType===thrownType){break}var adjusted_ptr_addr=info.ptr+16;if(___cxa_can_catch(caughtType,thrownType,adjusted_ptr_addr)){setTempRet0(caughtType);return thrown}}setTempRet0(thrownType);return thrown};function ___cxa_find_matching_catch_2(){return findMatchingCatch([])}function ___cxa_find_matching_catch_3(arg0){arg0>>>=0;return findMatchingCatch([arg0])}function ___cxa_find_matching_catch_4(arg0,arg1){arg0>>>=0;arg1>>>=0;return findMatchingCatch([arg0,arg1])}var ___cxa_rethrow=()=>{var info=exceptionCaught.pop();if(!info){abort("no exception to throw")}var ptr=info.excPtr;if(!info.get_rethrown()){exceptionCaught.push(info);info.set_rethrown(true);info.set_caught(false);uncaughtExceptionCount++}___cxa_increment_exception_refcount(ptr);exceptionLast=ptr;throw exceptionLast};function ___cxa_throw(ptr,type,destructor){ptr>>>=0;type>>>=0;destructor>>>=0;var info=new ExceptionInfo(ptr);info.init(type,destructor);___cxa_increment_exception_refcount(ptr);exceptionLast=ptr;uncaughtExceptionCount++;throw exceptionLast}var ___cxa_uncaught_exceptions=()=>uncaughtExceptionCount;function ___resumeException(ptr){ptr>>>=0;if(!exceptionLast){exceptionLast=ptr}throw exceptionLast}function ___syscall_chmod(path,mode){path>>>=0}function ___syscall_faccessat(dirfd,path,amode,flags){path>>>=0}var ___syscall_fchmod=(fd,mode)=>{};var ___syscall_fchown32=(fd,owner,group)=>{};var UTF8Decoder=globalThis.TextDecoder&&new TextDecoder;var findStringEnd=(heapOrArray,idx,maxBytesToRead,ignoreNul)=>{var maxIdx=idx+maxBytesToRead;if(ignoreNul)return maxIdx;while(heapOrArray[idx]&&!(idx>=maxIdx))++idx;return idx};var UTF8ArrayToString=(heapOrArray,idx=0,maxBytesToRead,ignoreNul)=>{idx>>>=0;var endPtr=findStringEnd(heapOrArray,idx,maxBytesToRead,ignoreNul);if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr))}var str="";while(idx<endPtr){var u0=heapOrArray[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heapOrArray[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heapOrArray[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heapOrArray[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str};var UTF8ToString=(ptr,maxBytesToRead,ignoreNul)=>{ptr>>>=0;return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead,ignoreNul):""};var SYSCALLS={varargs:undefined,getStr(ptr){var ret=UTF8ToString(ptr);return ret}};function ___syscall_fcntl64(fd,cmd,varargs){varargs>>>=0;SYSCALLS.varargs=varargs;return 0}function ___syscall_fstat64(fd,buf){buf>>>=0}function ___syscall_ftruncate64(fd,length){length=bigintToI53Checked(length)}function ___syscall_getcwd(buf,size){buf>>>=0;size>>>=0}function ___syscall_lstat64(path,buf){path>>>=0;buf>>>=0}function ___syscall_mkdirat(dirfd,path,mode){path>>>=0}function ___syscall_newfstatat(dirfd,path,buf,flags){path>>>=0;buf>>>=0}function ___syscall_openat(dirfd,path,flags,varargs){path>>>=0;varargs>>>=0;SYSCALLS.varargs=varargs}function ___syscall_readlinkat(dirfd,path,buf,bufsize){path>>>=0;buf>>>=0;bufsize>>>=0}function ___syscall_rmdir(path){path>>>=0}function ___syscall_stat64(path,buf){path>>>=0;buf>>>=0}function ___syscall_unlinkat(dirfd,path,flags){path>>>=0}function ___syscall_utimensat(dirfd,path,times,flags){path>>>=0;times>>>=0}var __abort_js=()=>abort("");var isLeapYear=year=>year%4===0&&(year%100!==0||year%400===0);var MONTH_DAYS_LEAP_CUMULATIVE=[0,31,60,91,121,152,182,213,244,274,305,335];var MONTH_DAYS_REGULAR_CUMULATIVE=[0,31,59,90,120,151,181,212,243,273,304,334];var ydayFromDate=date=>{var leap=isLeapYear(date.getFullYear());var monthDaysCumulative=leap?MONTH_DAYS_LEAP_CUMULATIVE:MONTH_DAYS_REGULAR_CUMULATIVE;var yday=monthDaysCumulative[date.getMonth()]+date.getDate()-1;return yday};function __localtime_js(time,tmPtr){time=bigintToI53Checked(time);tmPtr>>>=0;var date=new Date(time*1e3);HEAP32[tmPtr>>>2>>>0]=date.getSeconds();HEAP32[tmPtr+4>>>2>>>0]=date.getMinutes();HEAP32[tmPtr+8>>>2>>>0]=date.getHours();HEAP32[tmPtr+12>>>2>>>0]=date.getDate();HEAP32[tmPtr+16>>>2>>>0]=date.getMonth();HEAP32[tmPtr+20>>>2>>>0]=date.getFullYear()-1900;HEAP32[tmPtr+24>>>2>>>0]=date.getDay();var yday=ydayFromDate(date)|0;HEAP32[tmPtr+28>>>2>>>0]=yday;HEAP32[tmPtr+36>>>2>>>0]=-(date.getTimezoneOffset()*60);var start=new Date(date.getFullYear(),0,1);var summerOffset=new Date(date.getFullYear(),6,1).getTimezoneOffset();var winterOffset=start.getTimezoneOffset();var dst=(summerOffset!=winterOffset&&date.getTimezoneOffset()==Math.min(winterOffset,summerOffset))|0;HEAP32[tmPtr+32>>>2>>>0]=dst}var stringToUTF8Array=(str,heap,outIdx,maxBytesToWrite)=>{outIdx>>>=0;if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i<str.length;++i){var u=str.codePointAt(i);if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++>>>0]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++>>>0]=192|u>>6;heap[outIdx++>>>0]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++>>>0]=224|u>>12;heap[outIdx++>>>0]=128|u>>6&63;heap[outIdx++>>>0]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++>>>0]=240|u>>18;heap[outIdx++>>>0]=128|u>>12&63;heap[outIdx++>>>0]=128|u>>6&63;heap[outIdx++>>>0]=128|u&63;i++}}heap[outIdx>>>0]=0;return outIdx-startIdx};var stringToUTF8=(str,outPtr,maxBytesToWrite)=>stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite);var __tzset_js=function(timezone,daylight,std_name,dst_name){timezone>>>=0;daylight>>>=0;std_name>>>=0;dst_name>>>=0;var currentYear=(new Date).getFullYear();var winter=new Date(currentYear,0,1);var summer=new Date(currentYear,6,1);var winterOffset=winter.getTimezoneOffset();var summerOffset=summer.getTimezoneOffset();var stdTimezoneOffset=Math.max(winterOffset,summerOffset);HEAPU32[timezone>>>2>>>0]=stdTimezoneOffset*60;HEAP32[daylight>>>2>>>0]=Number(winterOffset!=summerOffset);var extractZone=timezoneOffset=>{var sign=timezoneOffset>=0?"-":"+";var absOffset=Math.abs(timezoneOffset);var hours=String(Math.floor(absOffset/60)).padStart(2,"0");var minutes=String(absOffset%60).padStart(2,"0");return`UTC${sign}${hours}${minutes}`};var winterName=extractZone(winterOffset);var summerName=extractZone(summerOffset);if(summerOffset<winterOffset){stringToUTF8(winterName,std_name,17);stringToUTF8(summerName,dst_name,17)}else{stringToUTF8(winterName,dst_name,17);stringToUTF8(summerName,std_name,17)}};var _emscripten_get_now=()=>performance.now();var _emscripten_date_now=()=>Date.now();var nowIsMonotonic=1;var checkWasiClock=clock_id=>clock_id>=0&&clock_id<=3;function _clock_time_get(clk_id,ignored_precision,ptime){ignored_precision=bigintToI53Checked(ignored_precision);ptime>>>=0;if(!checkWasiClock(clk_id)){return 28}var now;if(clk_id===0){now=_emscripten_date_now()}else if(nowIsMonotonic){now=_emscripten_get_now()}else{return 52}var nsec=Math.round(now*1e3*1e3);HEAP64[ptime>>>3>>>0]=BigInt(nsec);return 0}var getHeapMax=()=>4294901760;var alignMemory=(size,alignment)=>Math.ceil(size/alignment)*alignment;var growMemory=size=>{var oldHeapSize=wasmMemory.buffer.byteLength;var pages=(size-oldHeapSize+65535)/65536|0;try{wasmMemory.grow(pages);updateMemoryViews();return 1}catch(e){}};function _emscripten_resize_heap(requestedSize){requestedSize>>>=0;var oldSize=HEAPU8.length;var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignMemory(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=growMemory(newSize);if(replacement){return true}}return false}var ENV={};var getExecutableName=()=>thisProgram||"./this.program";var getEnvStrings=()=>{if(!getEnvStrings.strings){var lang=(globalThis.navigator?.language??"C").replace("-","_")+".UTF-8";var env={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:lang,_:getExecutableName()};for(var x in ENV){if(ENV[x]===undefined)delete env[x];else env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(`${x}=${env[x]}`)}getEnvStrings.strings=strings}return getEnvStrings.strings};function _environ_get(__environ,environ_buf){__environ>>>=0;environ_buf>>>=0;var bufSize=0;var envp=0;for(var string of getEnvStrings()){var ptr=environ_buf+bufSize;HEAPU32[__environ+envp>>>2>>>0]=ptr;bufSize+=stringToUTF8(string,ptr,Infinity)+1;envp+=4}return 0}var lengthBytesUTF8=str=>{var len=0;for(var i=0;i<str.length;++i){var c=str.charCodeAt(i);if(c<=127){len++}else if(c<=2047){len+=2}else if(c>=55296&&c<=57343){len+=4;++i}else{len+=3}}return len};function _environ_sizes_get(penviron_count,penviron_buf_size){penviron_count>>>=0;penviron_buf_size>>>=0;var strings=getEnvStrings();HEAPU32[penviron_count>>>2>>>0]=strings.length;var bufSize=0;for(var string of strings){bufSize+=lengthBytesUTF8(string)+1}HEAPU32[penviron_buf_size>>>2>>>0]=bufSize;return 0}var _fd_close=fd=>52;function _fd_fdstat_get(fd,pbuf){pbuf>>>=0;var rightsBase=0;var rightsInheriting=0;var flags=0;{var type=2;if(fd==0){rightsBase=2}else if(fd==1||fd==2){rightsBase=64}flags=1}HEAP8[pbuf>>>0]=type;HEAP16[pbuf+2>>>1>>>0]=flags;HEAP64[pbuf+8>>>3>>>0]=BigInt(rightsBase);HEAP64[pbuf+16>>>3>>>0]=BigInt(rightsInheriting);return 0}function _fd_read(fd,iov,iovcnt,pnum){iov>>>=0;iovcnt>>>=0;pnum>>>=0;return 52}function _fd_seek(fd,offset,whence,newOffset){offset=bigintToI53Checked(offset);newOffset>>>=0;return 70}var _fd_sync=fd=>52;var printCharBuffers=[null,[],[]];var printChar=(stream,curr)=>{var buffer=printCharBuffers[stream];if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer));buffer.length=0}else{buffer.push(curr)}};function _fd_write(fd,iov,iovcnt,pnum){iov>>>=0;iovcnt>>>=0;pnum>>>=0;var num=0;for(var i=0;i<iovcnt;i++){var ptr=HEAPU32[iov>>>2>>>0];var len=HEAPU32[iov+4>>>2>>>0];iov+=8;for(var j=0;j<len;j++){printChar(fd,HEAPU8[ptr+j>>>0])}num+=len}HEAPU32[pnum>>>2>>>0]=num;return 0}var flatsqlIoBridge={ERR_GENERIC:-1,ERR_NOENT:-2,ERR_ACCESS:-3,ERR_BADHANDLE:-6,backend:function(){return Module["flatsqlIO"]||null},path:function(ptr,len){return UTF8ToString(ptr,len)}};function _flatsql_io_close(handle){var io=flatsqlIoBridge.backend();if(!io)return flatsqlIoBridge.ERR_ACCESS;try{return io.close(handle)|0}catch(e){return flatsqlIoBridge.ERR_GENERIC}}function _flatsql_io_open(pathPtr,pathLen,flags){var io=flatsqlIoBridge.backend();if(!io)return flatsqlIoBridge.ERR_ACCESS;try{return io.open(flatsqlIoBridge.path(pathPtr,pathLen),flags)|0}catch(e){return flatsqlIoBridge.ERR_GENERIC}}function _flatsql_io_read(handle,dstPtr,len,offset){var io=flatsqlIoBridge.backend();if(!io)return flatsqlIoBridge.ERR_ACCESS;try{return io.read(handle,HEAPU8.subarray(dstPtr>>>0,dstPtr+len>>>0),offset)|0}catch(e){return flatsqlIoBridge.ERR_GENERIC}}function _flatsql_io_size(handle){var io=flatsqlIoBridge.backend();if(!io)return flatsqlIoBridge.ERR_ACCESS;try{return io.size(handle)}catch(e){return flatsqlIoBridge.ERR_GENERIC}}function _flatsql_io_sync(handle){var io=flatsqlIoBridge.backend();if(!io)return flatsqlIoBridge.ERR_ACCESS;try{return io.sync(handle)|0}catch(e){return flatsqlIoBridge.ERR_GENERIC}}function _flatsql_io_truncate(handle,size){var io=flatsqlIoBridge.backend();if(!io)return flatsqlIoBridge.ERR_ACCESS;try{return io.truncate(handle,size)|0}catch(e){return flatsqlIoBridge.ERR_GENERIC}}function _flatsql_io_write(handle,srcPtr,len,offset){var io=flatsqlIoBridge.backend();if(!io)return flatsqlIoBridge.ERR_ACCESS;try{return io.write(handle,HEAPU8.subarray(srcPtr>>>0,srcPtr+len>>>0),offset)|0}catch(e){return flatsqlIoBridge.ERR_GENERIC}}function _llvm_eh_typeid_for(type){type>>>=0;return type}var getCFunc=ident=>{var func=Module["_"+ident];return func};var writeArrayToMemory=(array,buffer)=>{HEAP8.set(array,buffer>>>0)};var stackAlloc=sz=>__emscripten_stack_alloc(sz);var stringToUTF8OnStack=str=>{var size=lengthBytesUTF8(str)+1;var ret=stackAlloc(size);stringToUTF8(str,ret,size);return ret};var ccall=(ident,returnType,argTypes,args,opts)=>{var toC={string:str=>{var ret=0;if(str!==null&&str!==undefined&&str!==0){ret=stringToUTF8OnStack(str)}return ret},array:arr=>{var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType==="string"){return UTF8ToString(ret)}if(returnType==="pointer")return ret>>>0;if(returnType==="boolean")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;if(args){for(var i=0;i<args.length;i++){var converter=toC[argTypes[i]];if(converter){if(stack===0)stack=stackSave();cArgs[i]=converter(args[i])}else{cArgs[i]=args[i]}}}var ret=func(...cArgs);function onDone(ret){if(stack!==0)stackRestore(stack);return convertReturnValue(ret)}ret=onDone(ret);return ret};var cwrap=(ident,returnType,argTypes,opts)=>{var numericArgs=!argTypes||argTypes.every(type=>type==="number"||type==="boolean");var numericRet=returnType!=="string";if(numericRet&&numericArgs&&!opts){return getCFunc(ident)}return(...args)=>ccall(ident,returnType,argTypes,args,opts)};{if(Module["noExitRuntime"])noExitRuntime=Module["noExitRuntime"];if(Module["print"])out=Module["print"];if(Module["printErr"])err=Module["printErr"];if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].shift()()}}}Module["ccall"]=ccall;Module["cwrap"]=cwrap;Module["UTF8ToString"]=UTF8ToString;Module["stringToUTF8"]=stringToUTF8;Module["lengthBytesUTF8"]=lengthBytesUTF8;var _free,_malloc,_flatsql_create_db,_flatsql_open_db,_flatsql_is_disk_backed,_flatsql_open_state,_flatsql_reindex_all,_flatsql_flush_index,_flatsql_flushed_offset,_flatsql_stream_path,_flatsql_destroy_db,_flatsql_register_file_id,_flatsql_enable_demo_extractors,_flatsql_ingest,_flatsql_ingest_one,_flatsql_register_source,_flatsql_create_unified_views,_flatsql_ingest_with_source,_flatsql_ingest_one_with_source,_flatsql_query,_flatsql_query_params,_flatsql_query_many,_flatsql_batch_result_count,_flatsql_select_batch_result,_flatsql_get_error,_flatsql_build_query_cache_key,_flatsql_build_response_artifact_cache_key,_flatsql_register_query_template,_flatsql_query_template,_flatsql_clear_query_cache,_flatsql_configure_query_cache,_flatsql_query_cache_hits,_flatsql_query_cache_misses,_flatsql_query_cache_size,_flatsql_query_cache_generation,_flatsql_query_cache_max_entries,_flatsql_query_cache_max_rows,_flatsql_result_column_count,_flatsql_result_row_count,_flatsql_result_column_name,_flatsql_result_cell_type,_flatsql_result_cell_number,_flatsql_result_cell_string,_flatsql_result_cell_blob,_flatsql_result_cell_blob_size,_flatsql_export_data,_flatsql_query_raw_flatbuffer_stream,_flatsql_query_sandboxed,_flatsql_response_artifact_data,_flatsql_response_artifact_size,_flatsql_response_artifact_cache_hit,_flatsql_configure_raw_stream_cache,_flatsql_raw_stream_cache_hits,_flatsql_raw_stream_cache_misses,_flatsql_raw_stream_cache_size,_flatsql_raw_stream_cache_total_bytes,_flatsql_response_artifact_row_count,_flatsql_response_artifact_column_count,_flatsql_export_size,_flatsql_load_and_rebuild,_flatsql_reserve_storage,_flatsql_load_from_db,_flatsql_create_test_user,_flatsql_test_buffer_size,_flatsql_create_test_post,_flatsql_create_test_mpe,_flatsql_create_test_telemetry,_flatsql_create_test_publish_event,_flatsql_get_stats_count,_flatsql_get_stat_table_name,_flatsql_get_stat_file_id,_flatsql_get_stat_record_count,_flatsql_reset_ingest_profile,_flatsql_get_ingest_profile_record_count,_flatsql_get_ingest_profile_byte_count,_flatsql_get_ingest_profile_decode_nanos,_flatsql_get_ingest_profile_append_nanos,_flatsql_get_ingest_profile_index_nanos,_flatsql_mark_deleted,_flatsql_get_deleted_count,_flatsql_clear_tombstones,_flatsql_get_sources_count,_flatsql_get_source_name,_flatsql_get_flatbuffer_by_id,_flatsql_get_flatbuffer_by_email,_flatsql_get_flatbuffer_by_index,_flatsql_get_raw_flatbuffer_size,_flatsql_get_raw_flatbuffer_sequence,_flatsql_get_storage_buffer,_flatsql_get_storage_size,_flatsql_set_encryption_key,_flatsql_is_encrypted,_flatsql_encrypt_buffer,_flatsql_decrypt_buffer,_flatsql_set_hmac_verification,_flatsql_is_hmac_enabled,_flatsql_compute_hmac,_flatsql_verify_hmac,_setThrew,__emscripten_tempret_set,__emscripten_stack_restore,__emscripten_stack_alloc,_emscripten_stack_get_current,___cxa_decrement_exception_refcount,___cxa_increment_exception_refcount,___cxa_can_catch,___cxa_get_exception_ptr,dynCall_v,dynCall_ii,dynCall_iii,dynCall_viiiiii,dynCall_vii,dynCall_viii,dynCall_iiii,dynCall_iiiiii,dynCall_vi,dynCall_viiii,dynCall_jii,dynCall_viiiii,dynCall_iiiiiii,dynCall_iiiii,dynCall_iiij,dynCall_iiid,dynCall_viijij,dynCall_viiijj,dynCall_jiiiii,dynCall_viiiiiiiiii,dynCall_vij,dynCall_iiji,dynCall_iijiii,dynCall_viij,dynCall_iid,dynCall_i,dynCall_dii,dynCall_di,dynCall_iiiid,dynCall_iij,dynCall_viidi,dynCall_vid,dynCall_vidd,dynCall_dd,dynCall_ddd,dynCall_jiiii,dynCall_viiiiiiii,dynCall_iiiddddddddi,dynCall_iiiij,dynCall_iijj,dynCall_iijii,dynCall_iidiiii,dynCall_j,dynCall_iiiiid,dynCall_viijii,dynCall_iiiiiiii,dynCall_iiiiiiiiiii,dynCall_iiiiiiiiiiiii,dynCall_fiii,dynCall_diii,dynCall_viiiiiii,dynCall_iiiiiiiiiiii,dynCall_viiiiiiiiiiiiiii,dynCall_iiiiiiiii,dynCall_iiiiij,dynCall_iiiiijj,dynCall_iiiiiijj,memory,__indirect_function_table,wasmMemory,wasmTable;function assignWasmExports(wasmExports){_free=Module["_free"]=wasmExports["Pa"];_malloc=Module["_malloc"]=wasmExports["Qa"];_flatsql_create_db=Module["_flatsql_create_db"]=wasmExports["Ra"];_flatsql_open_db=Module["_flatsql_open_db"]=wasmExports["Sa"];_flatsql_is_disk_backed=Module["_flatsql_is_disk_backed"]=wasmExports["Ta"];_flatsql_open_state=Module["_flatsql_open_state"]=wasmExports["Ua"];_flatsql_reindex_all=Module["_flatsql_reindex_all"]=wasmExports["Va"];_flatsql_flush_index=Module["_flatsql_flush_index"]=wasmExports["Wa"];_flatsql_flushed_offset=Module["_flatsql_flushed_offset"]=wasmExports["Xa"];_flatsql_stream_path=Module["_flatsql_stream_path"]=wasmExports["Ya"];_flatsql_destroy_db=Module["_flatsql_destroy_db"]=wasmExports["Za"];_flatsql_register_file_id=Module["_flatsql_register_file_id"]=wasmExports["_a"];_flatsql_enable_demo_extractors=Module["_flatsql_enable_demo_extractors"]=wasmExports["$a"];_flatsql_ingest=Module["_flatsql_ingest"]=wasmExports["ab"];_flatsql_ingest_one=Module["_flatsql_ingest_one"]=wasmExports["bb"];_flatsql_register_source=Module["_flatsql_register_source"]=wasmExports["cb"];_flatsql_create_unified_views=Module["_flatsql_create_unified_views"]=wasmExports["db"];_flatsql_ingest_with_source=Module["_flatsql_ingest_with_source"]=wasmExports["eb"];_flatsql_ingest_one_with_source=Module["_flatsql_ingest_one_with_source"]=wasmExports["fb"];_flatsql_query=Module["_flatsql_query"]=wasmExports["gb"];_flatsql_query_params=Module["_flatsql_query_params"]=wasmExports["hb"];_flatsql_query_many=Module["_flatsql_query_many"]=wasmExports["ib"];_flatsql_batch_result_count=Module["_flatsql_batch_result_count"]=wasmExports["jb"];_flatsql_select_batch_result=Module["_flatsql_select_batch_result"]=wasmExports["kb"];_flatsql_get_error=Module["_flatsql_get_error"]=wasmExports["lb"];_flatsql_build_query_cache_key=Module["_flatsql_build_query_cache_key"]=wasmExports["mb"];_flatsql_build_response_artifact_cache_key=Module["_flatsql_build_response_artifact_cache_key"]=wasmExports["nb"];_flatsql_register_query_template=Module["_flatsql_register_query_template"]=wasmExports["ob"];_flatsql_query_template=Module["_flatsql_query_template"]=wasmExports["pb"];_flatsql_clear_query_cache=Module["_flatsql_clear_query_cache"]=wasmExports["qb"];_flatsql_configure_query_cache=Module["_flatsql_configure_query_cache"]=wasmExports["rb"];_flatsql_query_cache_hits=Module["_flatsql_query_cache_hits"]=wasmExports["sb"];_flatsql_query_cache_misses=Module["_flatsql_query_cache_misses"]=wasmExports["tb"];_flatsql_query_cache_size=Module["_flatsql_query_cache_size"]=wasmExports["ub"];_flatsql_query_cache_generation=Module["_flatsql_query_cache_generation"]=wasmExports["vb"];_flatsql_query_cache_max_entries=Module["_flatsql_query_cache_max_entries"]=wasmExports["wb"];_flatsql_query_cache_max_rows=Module["_flatsql_query_cache_max_rows"]=wasmExports["xb"];_flatsql_result_column_count=Module["_flatsql_result_column_count"]=wasmExports["yb"];_flatsql_result_row_count=Module["_flatsql_result_row_count"]=wasmExports["zb"];_flatsql_result_column_name=Module["_flatsql_result_column_name"]=wasmExports["Ab"];_flatsql_result_cell_type=Module["_flatsql_result_cell_type"]=wasmExports["Bb"];_flatsql_result_cell_number=Module["_flatsql_result_cell_number"]=wasmExports["Cb"];_flatsql_result_cell_string=Module["_flatsql_result_cell_string"]=wasmExports["Db"];_flatsql_result_cell_blob=Module["_flatsql_result_cell_blob"]=wasmExports["Eb"];_flatsql_result_cell_blob_size=Module["_flatsql_result_cell_blob_size"]=wasmExports["Fb"];_flatsql_export_data=Module["_flatsql_export_data"]=wasmExports["Gb"];_flatsql_query_raw_flatbuffer_stream=Module["_flatsql_query_raw_flatbuffer_stream"]=wasmExports["Hb"];_flatsql_query_sandboxed=Module["_flatsql_query_sandboxed"]=wasmExports["Ib"];_flatsql_response_artifact_data=Module["_flatsql_response_artifact_data"]=wasmExports["Jb"];_flatsql_response_artifact_size=Module["_flatsql_response_artifact_size"]=wasmExports["Kb"];_flatsql_response_artifact_cache_hit=Module["_flatsql_response_artifact_cache_hit"]=wasmExports["Lb"];_flatsql_configure_raw_stream_cache=Module["_flatsql_configure_raw_stream_cache"]=wasmExports["Mb"];_flatsql_raw_stream_cache_hits=Module["_flatsql_raw_stream_cache_hits"]=wasmExports["Nb"];_flatsql_raw_stream_cache_misses=Module["_flatsql_raw_stream_cache_misses"]=wasmExports["Ob"];_flatsql_raw_stream_cache_size=Module["_flatsql_raw_stream_cache_size"]=wasmExports["Pb"];_flatsql_raw_stream_cache_total_bytes=Module["_flatsql_raw_stream_cache_total_bytes"]=wasmExports["Qb"];_flatsql_response_artifact_row_count=Module["_flatsql_response_artifact_row_count"]=wasmExports["Rb"];_flatsql_response_artifact_column_count=Module["_flatsql_response_artifact_column_count"]=wasmExports["Sb"];_flatsql_export_size=Module["_flatsql_export_size"]=wasmExports["Tb"];_flatsql_load_and_rebuild=Module["_flatsql_load_and_rebuild"]=wasmExports["Ub"];_flatsql_reserve_storage=Module["_flatsql_reserve_storage"]=wasmExports["Vb"];_flatsql_load_from_db=Module["_flatsql_load_from_db"]=wasmExports["Wb"];_flatsql_create_test_user=Module["_flatsql_create_test_user"]=wasmExports["Xb"];_flatsql_test_buffer_size=Module["_flatsql_test_buffer_size"]=wasmExports["Yb"];_flatsql_create_test_post=Module["_flatsql_create_test_post"]=wasmExports["Zb"];_flatsql_create_test_mpe=Module["_flatsql_create_test_mpe"]=wasmExports["_b"];_flatsql_create_test_telemetry=Module["_flatsql_create_test_telemetry"]=wasmExports["$b"];_flatsql_create_test_publish_event=Module["_flatsql_create_test_publish_event"]=wasmExports["ac"];_flatsql_get_stats_count=Module["_flatsql_get_stats_count"]=wasmExports["bc"];_flatsql_get_stat_table_name=Module["_flatsql_get_stat_table_name"]=wasmExports["cc"];_flatsql_get_stat_file_id=Module["_flatsql_get_stat_file_id"]=wasmExports["dc"];_flatsql_get_stat_record_count=Module["_flatsql_get_stat_record_count"]=wasmExports["ec"];_flatsql_reset_ingest_profile=Module["_flatsql_reset_ingest_profile"]=wasmExports["fc"];_flatsql_get_ingest_profile_record_count=Module["_flatsql_get_ingest_profile_record_count"]=wasmExports["gc"];_flatsql_get_ingest_profile_byte_count=Module["_flatsql_get_ingest_profile_byte_count"]=wasmExports["hc"];_flatsql_get_ingest_profile_decode_nanos=Module["_flatsql_get_ingest_profile_decode_nanos"]=wasmExports["ic"];_flatsql_get_ingest_profile_append_nanos=Module["_flatsql_get_ingest_profile_append_nanos"]=wasmExports["jc"];_flatsql_get_ingest_profile_index_nanos=Module["_flatsql_get_ingest_profile_index_nanos"]=wasmExports["kc"];_flatsql_mark_deleted=Module["_flatsql_mark_deleted"]=wasmExports["lc"];_flatsql_get_deleted_count=Module["_flatsql_get_deleted_count"]=wasmExports["mc"];_flatsql_clear_tombstones=Module["_flatsql_clear_tombstones"]=wasmExports["nc"];_flatsql_get_sources_count=Module["_flatsql_get_sources_count"]=wasmExports["oc"];_flatsql_get_source_name=Module["_flatsql_get_source_name"]=wasmExports["pc"];_flatsql_get_flatbuffer_by_id=Module["_flatsql_get_flatbuffer_by_id"]=wasmExports["qc"];_flatsql_get_flatbuffer_by_email=Module["_flatsql_get_flatbuffer_by_email"]=wasmExports["rc"];_flatsql_get_flatbuffer_by_index=Module["_flatsql_get_flatbuffer_by_index"]=wasmExports["sc"];_flatsql_get_raw_flatbuffer_size=Module["_flatsql_get_raw_flatbuffer_size"]=wasmExports["tc"];_flatsql_get_raw_flatbuffer_sequence=Module["_flatsql_get_raw_flatbuffer_sequence"]=wasmExports["uc"];_flatsql_get_storage_buffer=Module["_flatsql_get_storage_buffer"]=wasmExports["vc"];_flatsql_get_storage_size=Module["_flatsql_get_storage_size"]=wasmExports["wc"];_flatsql_set_encryption_key=Module["_flatsql_set_encryption_key"]=wasmExports["xc"];_flatsql_is_encrypted=Module["_flatsql_is_encrypted"]=wasmExports["yc"];_flatsql_encrypt_buffer=Module["_flatsql_encrypt_buffer"]=wasmExports["zc"];_flatsql_decrypt_buffer=Module["_flatsql_decrypt_buffer"]=wasmExports["Ac"];_flatsql_set_hmac_verification=Module["_flatsql_set_hmac_verification"]=wasmExports["Bc"];_flatsql_is_hmac_enabled=Module["_flatsql_is_hmac_enabled"]=wasmExports["Cc"];_flatsql_compute_hmac=Module["_flatsql_compute_hmac"]=wasmExports["Dc"];_flatsql_verify_hmac=Module["_flatsql_verify_hmac"]=wasmExports["Ec"];_setThrew=wasmExports["Fc"];__emscripten_tempret_set=wasmExports["Gc"];__emscripten_stack_restore=wasmExports["Hc"];__emscripten_stack_alloc=wasmExports["Ic"];_emscripten_stack_get_current=wasmExports["Jc"];___cxa_decrement_exception_refcount=wasmExports["Kc"];___cxa_increment_exception_refcount=wasmExports["Lc"];___cxa_can_catch=wasmExports["Mc"];___cxa_get_exception_ptr=wasmExports["Nc"];dynCall_v=wasmExports["Oc"];dynCall_ii=wasmExports["Pc"];dynCall_iii=wasmExports["Qc"];dynCall_viiiiii=wasmExports["Rc"];dynCall_vii=wasmExports["Sc"];dynCall_viii=wasmExports["Tc"];dynCall_iiii=wasmExports["Uc"];dynCall_iiiiii=wasmExports["Vc"];dynCall_vi=wasmExports["Wc"];dynCall_viiii=wasmExports["Xc"];dynCall_jii=wasmExports["Yc"];dynCall_viiiii=wasmExports["Zc"];dynCall_iiiiiii=wasmExports["_c"];dynCall_iiiii=wasmExports["$c"];dynCall_iiij=wasmExports["ad"];dynCall_iiid=wasmExports["bd"];dynCall_viijij=wasmExports["cd"];dynCall_viiijj=wasmExports["dd"];dynCall_jiiiii=wasmExports["ed"];dynCall_viiiiiiiiii=wasmExports["fd"];dynCall_vij=wasmExports["gd"];dynCall_iiji=wasmExports["hd"];dynCall_iijiii=wasmExports["id"];dynCall_viij=wasmExports["jd"];dynCall_iid=wasmExports["kd"];dynCall_i=wasmExports["ld"];dynCall_dii=wasmExports["md"];dynCall_di=wasmExports["nd"];dynCall_iiiid=wasmExports["od"];dynCall_iij=wasmExports["pd"];dynCall_viidi=wasmExports["qd"];dynCall_vid=wasmExports["rd"];dynCall_vidd=wasmExports["dynCall_vidd"];dynCall_dd=wasmExports["dynCall_dd"];dynCall_ddd=wasmExports["dynCall_ddd"];dynCall_jiiii=wasmExports["sd"];dynCall_viiiiiiii=wasmExports["td"];dynCall_iiiddddddddi=wasmExports["ud"];dynCall_iiiij=wasmExports["dynCall_iiiij"];dynCall_iijj=wasmExports["dynCall_iijj"];dynCall_iijii=wasmExports["dynCall_iijii"];dynCall_iidiiii=wasmExports["dynCall_iidiiii"];dynCall_j=wasmExports["vd"];dynCall_iiiiid=wasmExports["wd"];dynCall_viijii=wasmExports["dynCall_viijii"];dynCall_iiiiiiii=wasmExports["xd"];dynCall_iiiiiiiiiii=wasmExports["dynCall_iiiiiiiiiii"];dynCall_iiiiiiiiiiiii=wasmExports["dynCall_iiiiiiiiiiiii"];dynCall_fiii=wasmExports["yd"];dynCall_diii=wasmExports["zd"];dynCall_viiiiiii=wasmExports["Ad"];dynCall_iiiiiiiiiiii=wasmExports["Bd"];dynCall_viiiiiiiiiiiiiii=wasmExports["Cd"];dynCall_iiiiiiiii=wasmExports["dynCall_iiiiiiiii"];dynCall_iiiiij=wasmExports["dynCall_iiiiij"];dynCall_iiiiijj=wasmExports["dynCall_iiiiijj"];dynCall_iiiiiijj=wasmExports["dynCall_iiiiiijj"];memory=wasmMemory=wasmExports["Ma"];__indirect_function_table=wasmTable=wasmExports["Oa"]}var wasmImports={k:___cxa_begin_catch,q:___cxa_end_catch,a:___cxa_find_matching_catch_2,d:___cxa_find_matching_catch_3,u:___cxa_find_matching_catch_4,Y:___cxa_rethrow,o:___cxa_throw,ca:___cxa_uncaught_exceptions,e:___resumeException,Ca:___syscall_chmod,Ea:___syscall_faccessat,Da:___syscall_fchmod,Ba:___syscall_fchown32,y:___syscall_fcntl64,Aa:___syscall_fstat64,va:___syscall_ftruncate64,ua:___syscall_getcwd,xa:___syscall_lstat64,qa:___syscall_mkdirat,ya:___syscall_newfstatat,ma:___syscall_openat,ka:___syscall_readlinkat,ja:___syscall_rmdir,za:___syscall_stat64,ha:___syscall_unlinkat,ga:___syscall_utimensat,aa:__abort_js,oa:__localtime_js,pa:__tzset_js,na:_clock_time_get,P:_emscripten_date_now,O:_emscripten_get_now,ea:_emscripten_resize_heap,sa:_environ_get,ta:_environ_sizes_get,Q:_fd_close,fa:_fd_fdstat_get,la:_fd_read,ra:_fd_seek,wa:_fd_sync,ia:_fd_write,U:_flatsql_io_close,z:_flatsql_io_open,W:_flatsql_io_read,X:_flatsql_io_size,S:_flatsql_io_sync,Fa:_flatsql_io_truncate,T:_flatsql_io_write,x:invoke_di,H:invoke_dii,K:invoke_diii,M:invoke_fiii,t:invoke_i,c:invoke_ii,L:invoke_iid,g:invoke_iii,I:invoke_iiid,Ga:invoke_iiiddddddddi,h:invoke_iiii,V:invoke_iiiid,n:invoke_iiiii,ba:invoke_iiiiid,m:invoke_iiiiii,s:invoke_iiiiiii,N:invoke_iiiiiiii,F:invoke_iiiiiiiiiiii,La:invoke_iiij,Ia:invoke_iij,C:invoke_iiji,Ja:invoke_iijiii,da:invoke_j,J:invoke_jii,D:invoke_jiiii,Z:invoke_jiiiii,f:invoke_v,l:invoke_vi,G:invoke_vid,b:invoke_vii,R:invoke_viidi,i:invoke_viii,j:invoke_viiii,v:invoke_viiiii,r:invoke_viiiiii,w:invoke_viiiiiii,Ha:invoke_viiiiiiii,A:invoke_viiiiiiiiii,E:invoke_viiiiiiiiiiiiiii,_:invoke_viiijj,$:invoke_viij,Ka:invoke_viijij,B:invoke_vij,p:_llvm_eh_typeid_for};function invoke_v(index){var sp=stackSave();try{dynCall_v(index)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_ii(index,a1){var sp=stackSave();try{return dynCall_ii(index,a1)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iii(index,a1,a2){var sp=stackSave();try{return dynCall_iii(index,a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{dynCall_viiiiii(index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vii(index,a1,a2){var sp=stackSave();try{dynCall_vii(index,a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vij(index,a1,a2){var sp=stackSave();try{dynCall_vij(index,a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiii(index,a1,a2,a3){var sp=stackSave();try{return dynCall_iiii(index,a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viii(index,a1,a2,a3){var sp=stackSave();try{dynCall_viii(index,a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return dynCall_iiiiii(index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vi(index,a1){var sp=stackSave();try{dynCall_vi(index,a1)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiii(index,a1,a2,a3,a4){var sp=stackSave();try{dynCall_viiii(index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_jii(index,a1,a2){var sp=stackSave();try{return dynCall_jii(index,a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);return 0n}}function invoke_viiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{dynCall_viiiii(index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{return dynCall_iiiiiii(index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return dynCall_iiiii(index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiij(index,a1,a2,a3){var sp=stackSave();try{return dynCall_iiij(index,a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiid(index,a1,a2,a3){var sp=stackSave();try{return dynCall_iiid(index,a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viijij(index,a1,a2,a3,a4,a5){var sp=stackSave();try{dynCall_viijij(index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viij(index,a1,a2,a3){var sp=stackSave();try{dynCall_viij(index,a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiijj(index,a1,a2,a3,a4,a5){var sp=stackSave();try{dynCall_viiijj(index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_jiiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return dynCall_jiiiii(index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);return 0n}}function invoke_viiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{dynCall_viiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiji(index,a1,a2,a3){var sp=stackSave();try{return dynCall_iiji(index,a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iijiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return dynCall_iijiii(index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iid(index,a1,a2){var sp=stackSave();try{return dynCall_iid(index,a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_i(index){var sp=stackSave();try{return dynCall_i(index)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_dii(index,a1,a2){var sp=stackSave();try{return dynCall_dii(index,a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_di(index,a1){var sp=stackSave();try{return dynCall_di(index,a1)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiid(index,a1,a2,a3,a4){var sp=stackSave();try{return dynCall_iiiid(index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iij(index,a1,a2){var sp=stackSave();try{return dynCall_iij(index,a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viidi(index,a1,a2,a3,a4){var sp=stackSave();try{dynCall_viidi(index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vid(index,a1,a2){var sp=stackSave();try{dynCall_vid(index,a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_jiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return dynCall_jiiii(index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);return 0n}}function invoke_viiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8){var sp=stackSave();try{dynCall_viiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiddddddddi(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){var sp=stackSave();try{return dynCall_iiiddddddddi(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_j(index){var sp=stackSave();try{return dynCall_j(index)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);return 0n}}function invoke_iiiiid(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return dynCall_iiiiid(index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{return dynCall_iiiiiiii(index,a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_fiii(index,a1,a2,a3){var sp=stackSave();try{return dynCall_fiii(index,a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_diii(index,a1,a2,a3){var sp=stackSave();try{return dynCall_diii(index,a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{dynCall_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){var sp=stackSave();try{return dynCall_iiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15){var sp=stackSave();try{dynCall_viiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function applySignatureConversions(wasmExports){wasmExports=Object.assign({},wasmExports);var makeWrapper_pp=f=>a0=>f(a0)>>>0;var makeWrapper_p=f=>()=>f()>>>0;wasmExports["Qa"]=makeWrapper_pp(wasmExports["Qa"]);wasmExports["Ic"]=makeWrapper_pp(wasmExports["Ic"]);wasmExports["Jc"]=makeWrapper_p(wasmExports["Jc"]);wasmExports["Nc"]=makeWrapper_pp(wasmExports["Nc"]);return wasmExports}function run(){preRun();function doRun(){Module["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve?.(Module);Module["onRuntimeInitialized"]?.();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(()=>{setTimeout(()=>Module["setStatus"](""),1);doRun()},1)}else{doRun()}}var wasmExports;wasmExports=await (createWasm());run();if(runtimeInitialized){moduleRtn=Module}else{moduleRtn=new Promise((resolve,reject)=>{readyPromiseResolve=resolve;readyPromiseReject=reject})}
1
+ async function FlatSQL(moduleArg={}){var moduleRtn;var Module=moduleArg;var ENVIRONMENT_IS_WEB=!!globalThis.window;var ENVIRONMENT_IS_WORKER=!!globalThis.WorkerGlobalScope;var ENVIRONMENT_IS_NODE=globalThis.process?.versions?.node&&globalThis.process?.type!="renderer";if(ENVIRONMENT_IS_NODE){const{createRequire}=await import("module");var require=createRequire(import.meta.url)}var arguments_=[];var thisProgram="./this.program";var quit_=(status,toThrow)=>{throw toThrow};var _scriptName=import.meta.url;var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require("fs");if(_scriptName.startsWith("file:")){scriptDirectory=require("path").dirname(require("url").fileURLToPath(_scriptName))+"/"}readBinary=filename=>{filename=isFileURI(filename)?new URL(filename):filename;var ret=fs.readFileSync(filename);return ret};readAsync=async(filename,binary=true)=>{filename=isFileURI(filename)?new URL(filename):filename;var ret=fs.readFileSync(filename,binary?undefined:"utf8");return ret};if(process.argv.length>1){thisProgram=process.argv[1].replace(/\\/g,"/")}arguments_=process.argv.slice(2);quit_=(status,toThrow)=>{process.exitCode=status;throw toThrow}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){try{scriptDirectory=new URL(".",_scriptName).href}catch{}{if(ENVIRONMENT_IS_WORKER){readBinary=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=async url=>{var response=await fetch(url,{credentials:"same-origin"});if(response.ok){return response.arrayBuffer()}throw new Error(response.status+" : "+response.url)}}}else{}var out=console.log.bind(console);var err=console.error.bind(console);var wasmBinary;var ABORT=false;var isFileURI=filename=>filename.startsWith("file://");var readyPromiseResolve,readyPromiseReject;var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;var HEAP64,HEAPU64;var runtimeInitialized=false;function updateMemoryViews(){var b=wasmMemory.buffer;HEAP8=new Int8Array(b);HEAP16=new Int16Array(b);Module["HEAPU8"]=HEAPU8=new Uint8Array(b);HEAPU16=new Uint16Array(b);HEAP32=new Int32Array(b);HEAPU32=new Uint32Array(b);HEAPF32=new Float32Array(b);HEAPF64=new Float64Array(b);HEAP64=new BigInt64Array(b);HEAPU64=new BigUint64Array(b)}function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(onPreRuns)}function initRuntime(){runtimeInitialized=true;wasmExports["Oa"]()}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(onPostRuns)}function abort(what){Module["onAbort"]?.(what);what="Aborted("+what+")";err(what);ABORT=true;what+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(what);readyPromiseReject?.(e);throw e}var wasmBinaryFile;function findWasmBinary(){if(Module["locateFile"]){return locateFile("flatsql.wasm")}return new URL("flatsql.wasm",import.meta.url).href}function getBinarySync(file){if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}throw"both async and sync fetching of the wasm failed"}async function getWasmBinary(binaryFile){if(!wasmBinary){try{var response=await readAsync(binaryFile);return new Uint8Array(response)}catch{}}return getBinarySync(binaryFile)}async function instantiateArrayBuffer(binaryFile,imports){try{var binary=await getWasmBinary(binaryFile);var instance=await WebAssembly.instantiate(binary,imports);return instance}catch(reason){err(`failed to asynchronously prepare wasm: ${reason}`);abort(reason)}}async function instantiateAsync(binary,binaryFile,imports){if(!binary&&!ENVIRONMENT_IS_NODE){try{var response=fetch(binaryFile,{credentials:"same-origin"});var instantiationResult=await WebAssembly.instantiateStreaming(response,imports);return instantiationResult}catch(reason){err(`wasm streaming compile failed: ${reason}`);err("falling back to ArrayBuffer instantiation")}}return instantiateArrayBuffer(binaryFile,imports)}function getWasmImports(){var imports={a:wasmImports};return imports}async function createWasm(){function receiveInstance(instance,module){wasmExports=instance.exports;wasmExports=applySignatureConversions(wasmExports);assignWasmExports(wasmExports);updateMemoryViews();return wasmExports}function receiveInstantiationResult(result){return receiveInstance(result["instance"])}var info=getWasmImports();if(Module["instantiateWasm"]){return new Promise((resolve,reject)=>{Module["instantiateWasm"](info,(inst,mod)=>{resolve(receiveInstance(inst,mod))})})}wasmBinaryFile??=findWasmBinary();var result=await instantiateAsync(wasmBinary,wasmBinaryFile,info);var exports=receiveInstantiationResult(result);return exports}class ExitStatus{name="ExitStatus";constructor(status){this.message=`Program terminated with exit(${status})`;this.status=status}}var callRuntimeCallbacks=callbacks=>{while(callbacks.length>0){callbacks.shift()(Module)}};var onPostRuns=[];var addOnPostRun=cb=>onPostRuns.push(cb);var onPreRuns=[];var addOnPreRun=cb=>onPreRuns.push(cb);var noExitRuntime=true;var stackRestore=val=>__emscripten_stack_restore(val);var stackSave=()=>_emscripten_stack_get_current();var exceptionCaught=[];var uncaughtExceptionCount=0;var INT53_MAX=9007199254740992;var INT53_MIN=-9007199254740992;var bigintToI53Checked=num=>num<INT53_MIN||num>INT53_MAX?NaN:Number(num);function ___cxa_begin_catch(ptr){ptr>>>=0;var info=new ExceptionInfo(ptr);if(!info.get_caught()){info.set_caught(true);uncaughtExceptionCount--}info.set_rethrown(false);exceptionCaught.push(info);return ___cxa_get_exception_ptr(ptr)}var exceptionLast=0;var ___cxa_end_catch=()=>{_setThrew(0,0);var info=exceptionCaught.pop();___cxa_decrement_exception_refcount(info.excPtr);exceptionLast=0};class ExceptionInfo{constructor(excPtr){this.excPtr=excPtr;this.ptr=excPtr-24}set_type(type){HEAPU32[this.ptr+4>>>2>>>0]=type}get_type(){return HEAPU32[this.ptr+4>>>2>>>0]}set_destructor(destructor){HEAPU32[this.ptr+8>>>2>>>0]=destructor}get_destructor(){return HEAPU32[this.ptr+8>>>2>>>0]}set_caught(caught){caught=caught?1:0;HEAP8[this.ptr+12>>>0]=caught}get_caught(){return HEAP8[this.ptr+12>>>0]!=0}set_rethrown(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+13>>>0]=rethrown}get_rethrown(){return HEAP8[this.ptr+13>>>0]!=0}init(type,destructor){this.set_adjusted_ptr(0);this.set_type(type);this.set_destructor(destructor)}set_adjusted_ptr(adjustedPtr){HEAPU32[this.ptr+16>>>2>>>0]=adjustedPtr}get_adjusted_ptr(){return HEAPU32[this.ptr+16>>>2>>>0]}}var setTempRet0=val=>__emscripten_tempret_set(val);var findMatchingCatch=args=>{var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0}var info=new ExceptionInfo(thrown);info.set_adjusted_ptr(thrown);var thrownType=info.get_type();if(!thrownType){setTempRet0(0);return thrown}for(var caughtType of args){if(caughtType===0||caughtType===thrownType){break}var adjusted_ptr_addr=info.ptr+16;if(___cxa_can_catch(caughtType,thrownType,adjusted_ptr_addr)){setTempRet0(caughtType);return thrown}}setTempRet0(thrownType);return thrown};function ___cxa_find_matching_catch_2(){return findMatchingCatch([])}function ___cxa_find_matching_catch_3(arg0){arg0>>>=0;return findMatchingCatch([arg0])}function ___cxa_find_matching_catch_4(arg0,arg1){arg0>>>=0;arg1>>>=0;return findMatchingCatch([arg0,arg1])}var ___cxa_rethrow=()=>{var info=exceptionCaught.pop();if(!info){abort("no exception to throw")}var ptr=info.excPtr;if(!info.get_rethrown()){exceptionCaught.push(info);info.set_rethrown(true);info.set_caught(false);uncaughtExceptionCount++}___cxa_increment_exception_refcount(ptr);exceptionLast=ptr;throw exceptionLast};function ___cxa_throw(ptr,type,destructor){ptr>>>=0;type>>>=0;destructor>>>=0;var info=new ExceptionInfo(ptr);info.init(type,destructor);___cxa_increment_exception_refcount(ptr);exceptionLast=ptr;uncaughtExceptionCount++;throw exceptionLast}var ___cxa_uncaught_exceptions=()=>uncaughtExceptionCount;function ___resumeException(ptr){ptr>>>=0;if(!exceptionLast){exceptionLast=ptr}throw exceptionLast}function ___syscall_chmod(path,mode){path>>>=0}function ___syscall_faccessat(dirfd,path,amode,flags){path>>>=0}var ___syscall_fchmod=(fd,mode)=>{};var ___syscall_fchown32=(fd,owner,group)=>{};var UTF8Decoder=globalThis.TextDecoder&&new TextDecoder;var findStringEnd=(heapOrArray,idx,maxBytesToRead,ignoreNul)=>{var maxIdx=idx+maxBytesToRead;if(ignoreNul)return maxIdx;while(heapOrArray[idx]&&!(idx>=maxIdx))++idx;return idx};var UTF8ArrayToString=(heapOrArray,idx=0,maxBytesToRead,ignoreNul)=>{idx>>>=0;var endPtr=findStringEnd(heapOrArray,idx,maxBytesToRead,ignoreNul);if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr))}var str="";while(idx<endPtr){var u0=heapOrArray[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heapOrArray[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heapOrArray[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heapOrArray[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str};var UTF8ToString=(ptr,maxBytesToRead,ignoreNul)=>{ptr>>>=0;return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead,ignoreNul):""};var SYSCALLS={varargs:undefined,getStr(ptr){var ret=UTF8ToString(ptr);return ret}};function ___syscall_fcntl64(fd,cmd,varargs){varargs>>>=0;SYSCALLS.varargs=varargs;return 0}function ___syscall_fstat64(fd,buf){buf>>>=0}function ___syscall_ftruncate64(fd,length){length=bigintToI53Checked(length)}function ___syscall_getcwd(buf,size){buf>>>=0;size>>>=0}function ___syscall_lstat64(path,buf){path>>>=0;buf>>>=0}function ___syscall_mkdirat(dirfd,path,mode){path>>>=0}function ___syscall_newfstatat(dirfd,path,buf,flags){path>>>=0;buf>>>=0}function ___syscall_openat(dirfd,path,flags,varargs){path>>>=0;varargs>>>=0;SYSCALLS.varargs=varargs}function ___syscall_readlinkat(dirfd,path,buf,bufsize){path>>>=0;buf>>>=0;bufsize>>>=0}function ___syscall_rmdir(path){path>>>=0}function ___syscall_stat64(path,buf){path>>>=0;buf>>>=0}function ___syscall_unlinkat(dirfd,path,flags){path>>>=0}function ___syscall_utimensat(dirfd,path,times,flags){path>>>=0;times>>>=0}var __abort_js=()=>abort("");var isLeapYear=year=>year%4===0&&(year%100!==0||year%400===0);var MONTH_DAYS_LEAP_CUMULATIVE=[0,31,60,91,121,152,182,213,244,274,305,335];var MONTH_DAYS_REGULAR_CUMULATIVE=[0,31,59,90,120,151,181,212,243,273,304,334];var ydayFromDate=date=>{var leap=isLeapYear(date.getFullYear());var monthDaysCumulative=leap?MONTH_DAYS_LEAP_CUMULATIVE:MONTH_DAYS_REGULAR_CUMULATIVE;var yday=monthDaysCumulative[date.getMonth()]+date.getDate()-1;return yday};function __localtime_js(time,tmPtr){time=bigintToI53Checked(time);tmPtr>>>=0;var date=new Date(time*1e3);HEAP32[tmPtr>>>2>>>0]=date.getSeconds();HEAP32[tmPtr+4>>>2>>>0]=date.getMinutes();HEAP32[tmPtr+8>>>2>>>0]=date.getHours();HEAP32[tmPtr+12>>>2>>>0]=date.getDate();HEAP32[tmPtr+16>>>2>>>0]=date.getMonth();HEAP32[tmPtr+20>>>2>>>0]=date.getFullYear()-1900;HEAP32[tmPtr+24>>>2>>>0]=date.getDay();var yday=ydayFromDate(date)|0;HEAP32[tmPtr+28>>>2>>>0]=yday;HEAP32[tmPtr+36>>>2>>>0]=-(date.getTimezoneOffset()*60);var start=new Date(date.getFullYear(),0,1);var summerOffset=new Date(date.getFullYear(),6,1).getTimezoneOffset();var winterOffset=start.getTimezoneOffset();var dst=(summerOffset!=winterOffset&&date.getTimezoneOffset()==Math.min(winterOffset,summerOffset))|0;HEAP32[tmPtr+32>>>2>>>0]=dst}var stringToUTF8Array=(str,heap,outIdx,maxBytesToWrite)=>{outIdx>>>=0;if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i<str.length;++i){var u=str.codePointAt(i);if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++>>>0]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++>>>0]=192|u>>6;heap[outIdx++>>>0]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++>>>0]=224|u>>12;heap[outIdx++>>>0]=128|u>>6&63;heap[outIdx++>>>0]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++>>>0]=240|u>>18;heap[outIdx++>>>0]=128|u>>12&63;heap[outIdx++>>>0]=128|u>>6&63;heap[outIdx++>>>0]=128|u&63;i++}}heap[outIdx>>>0]=0;return outIdx-startIdx};var stringToUTF8=(str,outPtr,maxBytesToWrite)=>stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite);var __tzset_js=function(timezone,daylight,std_name,dst_name){timezone>>>=0;daylight>>>=0;std_name>>>=0;dst_name>>>=0;var currentYear=(new Date).getFullYear();var winter=new Date(currentYear,0,1);var summer=new Date(currentYear,6,1);var winterOffset=winter.getTimezoneOffset();var summerOffset=summer.getTimezoneOffset();var stdTimezoneOffset=Math.max(winterOffset,summerOffset);HEAPU32[timezone>>>2>>>0]=stdTimezoneOffset*60;HEAP32[daylight>>>2>>>0]=Number(winterOffset!=summerOffset);var extractZone=timezoneOffset=>{var sign=timezoneOffset>=0?"-":"+";var absOffset=Math.abs(timezoneOffset);var hours=String(Math.floor(absOffset/60)).padStart(2,"0");var minutes=String(absOffset%60).padStart(2,"0");return`UTC${sign}${hours}${minutes}`};var winterName=extractZone(winterOffset);var summerName=extractZone(summerOffset);if(summerOffset<winterOffset){stringToUTF8(winterName,std_name,17);stringToUTF8(summerName,dst_name,17)}else{stringToUTF8(winterName,dst_name,17);stringToUTF8(summerName,std_name,17)}};var _emscripten_get_now=()=>performance.now();var _emscripten_date_now=()=>Date.now();var nowIsMonotonic=1;var checkWasiClock=clock_id=>clock_id>=0&&clock_id<=3;function _clock_time_get(clk_id,ignored_precision,ptime){ignored_precision=bigintToI53Checked(ignored_precision);ptime>>>=0;if(!checkWasiClock(clk_id)){return 28}var now;if(clk_id===0){now=_emscripten_date_now()}else if(nowIsMonotonic){now=_emscripten_get_now()}else{return 52}var nsec=Math.round(now*1e3*1e3);HEAP64[ptime>>>3>>>0]=BigInt(nsec);return 0}var getHeapMax=()=>4294901760;var alignMemory=(size,alignment)=>Math.ceil(size/alignment)*alignment;var growMemory=size=>{var oldHeapSize=wasmMemory.buffer.byteLength;var pages=(size-oldHeapSize+65535)/65536|0;try{wasmMemory.grow(pages);updateMemoryViews();return 1}catch(e){}};function _emscripten_resize_heap(requestedSize){requestedSize>>>=0;var oldSize=HEAPU8.length;var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignMemory(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=growMemory(newSize);if(replacement){return true}}return false}var ENV={};var getExecutableName=()=>thisProgram||"./this.program";var getEnvStrings=()=>{if(!getEnvStrings.strings){var lang=(globalThis.navigator?.language??"C").replace("-","_")+".UTF-8";var env={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:lang,_:getExecutableName()};for(var x in ENV){if(ENV[x]===undefined)delete env[x];else env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(`${x}=${env[x]}`)}getEnvStrings.strings=strings}return getEnvStrings.strings};function _environ_get(__environ,environ_buf){__environ>>>=0;environ_buf>>>=0;var bufSize=0;var envp=0;for(var string of getEnvStrings()){var ptr=environ_buf+bufSize;HEAPU32[__environ+envp>>>2>>>0]=ptr;bufSize+=stringToUTF8(string,ptr,Infinity)+1;envp+=4}return 0}var lengthBytesUTF8=str=>{var len=0;for(var i=0;i<str.length;++i){var c=str.charCodeAt(i);if(c<=127){len++}else if(c<=2047){len+=2}else if(c>=55296&&c<=57343){len+=4;++i}else{len+=3}}return len};function _environ_sizes_get(penviron_count,penviron_buf_size){penviron_count>>>=0;penviron_buf_size>>>=0;var strings=getEnvStrings();HEAPU32[penviron_count>>>2>>>0]=strings.length;var bufSize=0;for(var string of strings){bufSize+=lengthBytesUTF8(string)+1}HEAPU32[penviron_buf_size>>>2>>>0]=bufSize;return 0}var _fd_close=fd=>52;function _fd_fdstat_get(fd,pbuf){pbuf>>>=0;var rightsBase=0;var rightsInheriting=0;var flags=0;{var type=2;if(fd==0){rightsBase=2}else if(fd==1||fd==2){rightsBase=64}flags=1}HEAP8[pbuf>>>0]=type;HEAP16[pbuf+2>>>1>>>0]=flags;HEAP64[pbuf+8>>>3>>>0]=BigInt(rightsBase);HEAP64[pbuf+16>>>3>>>0]=BigInt(rightsInheriting);return 0}function _fd_read(fd,iov,iovcnt,pnum){iov>>>=0;iovcnt>>>=0;pnum>>>=0;return 52}function _fd_seek(fd,offset,whence,newOffset){offset=bigintToI53Checked(offset);newOffset>>>=0;return 70}var _fd_sync=fd=>52;var printCharBuffers=[null,[],[]];var printChar=(stream,curr)=>{var buffer=printCharBuffers[stream];if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer));buffer.length=0}else{buffer.push(curr)}};function _fd_write(fd,iov,iovcnt,pnum){iov>>>=0;iovcnt>>>=0;pnum>>>=0;var num=0;for(var i=0;i<iovcnt;i++){var ptr=HEAPU32[iov>>>2>>>0];var len=HEAPU32[iov+4>>>2>>>0];iov+=8;for(var j=0;j<len;j++){printChar(fd,HEAPU8[ptr+j>>>0])}num+=len}HEAPU32[pnum>>>2>>>0]=num;return 0}var flatsqlIoBridge={ERR_GENERIC:-1,ERR_NOENT:-2,ERR_ACCESS:-3,ERR_BADHANDLE:-6,backend:function(){return Module["flatsqlIO"]||null},path:function(ptr,len){return UTF8ToString(ptr,len)}};function _flatsql_io_close(handle){var io=flatsqlIoBridge.backend();if(!io)return flatsqlIoBridge.ERR_ACCESS;try{return io.close(handle)|0}catch(e){return flatsqlIoBridge.ERR_GENERIC}}function _flatsql_io_open(pathPtr,pathLen,flags){var io=flatsqlIoBridge.backend();if(!io)return flatsqlIoBridge.ERR_ACCESS;try{return io.open(flatsqlIoBridge.path(pathPtr,pathLen),flags)|0}catch(e){return flatsqlIoBridge.ERR_GENERIC}}function _flatsql_io_read(handle,dstPtr,len,offset){var io=flatsqlIoBridge.backend();if(!io)return flatsqlIoBridge.ERR_ACCESS;try{return io.read(handle,HEAPU8.subarray(dstPtr>>>0,dstPtr+len>>>0),offset)|0}catch(e){return flatsqlIoBridge.ERR_GENERIC}}function _flatsql_io_size(handle){var io=flatsqlIoBridge.backend();if(!io)return flatsqlIoBridge.ERR_ACCESS;try{return io.size(handle)}catch(e){return flatsqlIoBridge.ERR_GENERIC}}function _flatsql_io_sync(handle){var io=flatsqlIoBridge.backend();if(!io)return flatsqlIoBridge.ERR_ACCESS;try{return io.sync(handle)|0}catch(e){return flatsqlIoBridge.ERR_GENERIC}}function _flatsql_io_truncate(handle,size){var io=flatsqlIoBridge.backend();if(!io)return flatsqlIoBridge.ERR_ACCESS;try{return io.truncate(handle,size)|0}catch(e){return flatsqlIoBridge.ERR_GENERIC}}function _flatsql_io_write(handle,srcPtr,len,offset){var io=flatsqlIoBridge.backend();if(!io)return flatsqlIoBridge.ERR_ACCESS;try{return io.write(handle,HEAPU8.subarray(srcPtr>>>0,srcPtr+len>>>0),offset)|0}catch(e){return flatsqlIoBridge.ERR_GENERIC}}function _llvm_eh_typeid_for(type){type>>>=0;return type}var getCFunc=ident=>{var func=Module["_"+ident];return func};var writeArrayToMemory=(array,buffer)=>{HEAP8.set(array,buffer>>>0)};var stackAlloc=sz=>__emscripten_stack_alloc(sz);var stringToUTF8OnStack=str=>{var size=lengthBytesUTF8(str)+1;var ret=stackAlloc(size);stringToUTF8(str,ret,size);return ret};var ccall=(ident,returnType,argTypes,args,opts)=>{var toC={string:str=>{var ret=0;if(str!==null&&str!==undefined&&str!==0){ret=stringToUTF8OnStack(str)}return ret},array:arr=>{var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType==="string"){return UTF8ToString(ret)}if(returnType==="pointer")return ret>>>0;if(returnType==="boolean")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;if(args){for(var i=0;i<args.length;i++){var converter=toC[argTypes[i]];if(converter){if(stack===0)stack=stackSave();cArgs[i]=converter(args[i])}else{cArgs[i]=args[i]}}}var ret=func(...cArgs);function onDone(ret){if(stack!==0)stackRestore(stack);return convertReturnValue(ret)}ret=onDone(ret);return ret};var cwrap=(ident,returnType,argTypes,opts)=>{var numericArgs=!argTypes||argTypes.every(type=>type==="number"||type==="boolean");var numericRet=returnType!=="string";if(numericRet&&numericArgs&&!opts){return getCFunc(ident)}return(...args)=>ccall(ident,returnType,argTypes,args,opts)};{if(Module["noExitRuntime"])noExitRuntime=Module["noExitRuntime"];if(Module["print"])out=Module["print"];if(Module["printErr"])err=Module["printErr"];if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].shift()()}}}Module["ccall"]=ccall;Module["cwrap"]=cwrap;Module["UTF8ToString"]=UTF8ToString;Module["stringToUTF8"]=stringToUTF8;Module["lengthBytesUTF8"]=lengthBytesUTF8;var _free,_malloc,_flatsql_create_db,_flatsql_open_db,_flatsql_is_disk_backed,_flatsql_open_state,_flatsql_reindex_all,_flatsql_flush_index,_flatsql_flushed_offset,_flatsql_stream_path,_flatsql_destroy_db,_flatsql_register_file_id,_flatsql_enable_demo_extractors,_flatsql_ingest,_flatsql_ingest_one,_flatsql_register_source,_flatsql_create_unified_views,_flatsql_ingest_with_source,_flatsql_ingest_one_with_source,_flatsql_query,_flatsql_query_params,_flatsql_query_many,_flatsql_batch_result_count,_flatsql_select_batch_result,_flatsql_get_error,_flatsql_build_query_cache_key,_flatsql_build_response_artifact_cache_key,_flatsql_register_query_template,_flatsql_query_template,_flatsql_clear_query_cache,_flatsql_configure_query_cache,_flatsql_query_cache_hits,_flatsql_query_cache_misses,_flatsql_query_cache_size,_flatsql_query_cache_generation,_flatsql_query_cache_max_entries,_flatsql_query_cache_max_rows,_flatsql_result_column_count,_flatsql_result_row_count,_flatsql_result_column_name,_flatsql_result_cell_type,_flatsql_result_cell_number,_flatsql_result_cell_string,_flatsql_result_cell_blob,_flatsql_result_cell_blob_size,_flatsql_export_data,_flatsql_query_raw_flatbuffer_stream,_flatsql_query_sandboxed,_flatsql_response_artifact_data,_flatsql_response_artifact_size,_flatsql_response_artifact_cache_hit,_flatsql_configure_raw_stream_cache,_flatsql_raw_stream_cache_hits,_flatsql_raw_stream_cache_misses,_flatsql_raw_stream_cache_size,_flatsql_raw_stream_cache_total_bytes,_flatsql_response_artifact_row_count,_flatsql_response_artifact_column_count,_flatsql_export_size,_flatsql_load_and_rebuild,_flatsql_reserve_storage,_flatsql_load_from_db,_flatsql_create_test_user,_flatsql_test_buffer_size,_flatsql_create_test_post,_flatsql_create_test_mpe,_flatsql_create_test_telemetry,_flatsql_create_test_publish_event,_flatsql_get_stats_count,_flatsql_get_stat_table_name,_flatsql_get_stat_file_id,_flatsql_get_stat_record_count,_flatsql_reset_ingest_profile,_flatsql_get_ingest_profile_record_count,_flatsql_get_ingest_profile_byte_count,_flatsql_get_ingest_profile_decode_nanos,_flatsql_get_ingest_profile_append_nanos,_flatsql_get_ingest_profile_index_nanos,_flatsql_mark_deleted,_flatsql_get_deleted_count,_flatsql_clear_tombstones,_flatsql_get_sources_count,_flatsql_get_source_name,_flatsql_get_flatbuffer_by_id,_flatsql_get_flatbuffer_by_email,_flatsql_get_flatbuffer_by_index,_flatsql_get_raw_flatbuffer_size,_flatsql_get_raw_flatbuffer_sequence,_flatsql_get_storage_buffer,_flatsql_get_storage_size,_flatsql_set_encryption_key,_flatsql_is_encrypted,_flatsql_encrypt_buffer,_flatsql_decrypt_buffer,_flatsql_set_hmac_verification,_flatsql_is_hmac_enabled,_flatsql_compute_hmac,_flatsql_verify_hmac,_setThrew,__emscripten_tempret_set,__emscripten_stack_restore,__emscripten_stack_alloc,_emscripten_stack_get_current,___cxa_decrement_exception_refcount,___cxa_increment_exception_refcount,___cxa_can_catch,___cxa_get_exception_ptr,dynCall_v,dynCall_ii,dynCall_iii,dynCall_viiiiii,dynCall_vii,dynCall_viii,dynCall_iiii,dynCall_iiiiii,dynCall_vi,dynCall_viiii,dynCall_jii,dynCall_viiiii,dynCall_iiiiiii,dynCall_iiiii,dynCall_iiij,dynCall_iiid,dynCall_viijij,dynCall_viiijj,dynCall_jiiiii,dynCall_iiiiiiiiiiii,dynCall_vij,dynCall_iiji,dynCall_iijiii,dynCall_viijj,dynCall_viij,dynCall_iid,dynCall_i,dynCall_dii,dynCall_di,dynCall_iiiid,dynCall_iij,dynCall_viidi,dynCall_vid,dynCall_vidd,dynCall_dd,dynCall_ddd,dynCall_jiiii,dynCall_viiiiiiii,dynCall_iiiddddddddi,dynCall_iiiij,dynCall_iijj,dynCall_iijii,dynCall_iidiiii,dynCall_j,dynCall_iiiiid,dynCall_viijii,dynCall_iiiiiiii,dynCall_iiiiiiiiiii,dynCall_iiiiiiiiiiiii,dynCall_fiii,dynCall_diii,dynCall_viiiiiii,dynCall_viiiiiiiiii,dynCall_viiiiiiiiiiiiiii,dynCall_iiiiiiiii,dynCall_iiiiij,dynCall_iiiiijj,dynCall_iiiiiijj,memory,__indirect_function_table,wasmMemory,wasmTable;function assignWasmExports(wasmExports){_free=Module["_free"]=wasmExports["Qa"];_malloc=Module["_malloc"]=wasmExports["Ra"];_flatsql_create_db=Module["_flatsql_create_db"]=wasmExports["Sa"];_flatsql_open_db=Module["_flatsql_open_db"]=wasmExports["Ta"];_flatsql_is_disk_backed=Module["_flatsql_is_disk_backed"]=wasmExports["Ua"];_flatsql_open_state=Module["_flatsql_open_state"]=wasmExports["Va"];_flatsql_reindex_all=Module["_flatsql_reindex_all"]=wasmExports["Wa"];_flatsql_flush_index=Module["_flatsql_flush_index"]=wasmExports["Xa"];_flatsql_flushed_offset=Module["_flatsql_flushed_offset"]=wasmExports["Ya"];_flatsql_stream_path=Module["_flatsql_stream_path"]=wasmExports["Za"];_flatsql_destroy_db=Module["_flatsql_destroy_db"]=wasmExports["_a"];_flatsql_register_file_id=Module["_flatsql_register_file_id"]=wasmExports["$a"];_flatsql_enable_demo_extractors=Module["_flatsql_enable_demo_extractors"]=wasmExports["ab"];_flatsql_ingest=Module["_flatsql_ingest"]=wasmExports["bb"];_flatsql_ingest_one=Module["_flatsql_ingest_one"]=wasmExports["cb"];_flatsql_register_source=Module["_flatsql_register_source"]=wasmExports["db"];_flatsql_create_unified_views=Module["_flatsql_create_unified_views"]=wasmExports["eb"];_flatsql_ingest_with_source=Module["_flatsql_ingest_with_source"]=wasmExports["fb"];_flatsql_ingest_one_with_source=Module["_flatsql_ingest_one_with_source"]=wasmExports["gb"];_flatsql_query=Module["_flatsql_query"]=wasmExports["hb"];_flatsql_query_params=Module["_flatsql_query_params"]=wasmExports["ib"];_flatsql_query_many=Module["_flatsql_query_many"]=wasmExports["jb"];_flatsql_batch_result_count=Module["_flatsql_batch_result_count"]=wasmExports["kb"];_flatsql_select_batch_result=Module["_flatsql_select_batch_result"]=wasmExports["lb"];_flatsql_get_error=Module["_flatsql_get_error"]=wasmExports["mb"];_flatsql_build_query_cache_key=Module["_flatsql_build_query_cache_key"]=wasmExports["nb"];_flatsql_build_response_artifact_cache_key=Module["_flatsql_build_response_artifact_cache_key"]=wasmExports["ob"];_flatsql_register_query_template=Module["_flatsql_register_query_template"]=wasmExports["pb"];_flatsql_query_template=Module["_flatsql_query_template"]=wasmExports["qb"];_flatsql_clear_query_cache=Module["_flatsql_clear_query_cache"]=wasmExports["rb"];_flatsql_configure_query_cache=Module["_flatsql_configure_query_cache"]=wasmExports["sb"];_flatsql_query_cache_hits=Module["_flatsql_query_cache_hits"]=wasmExports["tb"];_flatsql_query_cache_misses=Module["_flatsql_query_cache_misses"]=wasmExports["ub"];_flatsql_query_cache_size=Module["_flatsql_query_cache_size"]=wasmExports["vb"];_flatsql_query_cache_generation=Module["_flatsql_query_cache_generation"]=wasmExports["wb"];_flatsql_query_cache_max_entries=Module["_flatsql_query_cache_max_entries"]=wasmExports["xb"];_flatsql_query_cache_max_rows=Module["_flatsql_query_cache_max_rows"]=wasmExports["yb"];_flatsql_result_column_count=Module["_flatsql_result_column_count"]=wasmExports["zb"];_flatsql_result_row_count=Module["_flatsql_result_row_count"]=wasmExports["Ab"];_flatsql_result_column_name=Module["_flatsql_result_column_name"]=wasmExports["Bb"];_flatsql_result_cell_type=Module["_flatsql_result_cell_type"]=wasmExports["Cb"];_flatsql_result_cell_number=Module["_flatsql_result_cell_number"]=wasmExports["Db"];_flatsql_result_cell_string=Module["_flatsql_result_cell_string"]=wasmExports["Eb"];_flatsql_result_cell_blob=Module["_flatsql_result_cell_blob"]=wasmExports["Fb"];_flatsql_result_cell_blob_size=Module["_flatsql_result_cell_blob_size"]=wasmExports["Gb"];_flatsql_export_data=Module["_flatsql_export_data"]=wasmExports["Hb"];_flatsql_query_raw_flatbuffer_stream=Module["_flatsql_query_raw_flatbuffer_stream"]=wasmExports["Ib"];_flatsql_query_sandboxed=Module["_flatsql_query_sandboxed"]=wasmExports["Jb"];_flatsql_response_artifact_data=Module["_flatsql_response_artifact_data"]=wasmExports["Kb"];_flatsql_response_artifact_size=Module["_flatsql_response_artifact_size"]=wasmExports["Lb"];_flatsql_response_artifact_cache_hit=Module["_flatsql_response_artifact_cache_hit"]=wasmExports["Mb"];_flatsql_configure_raw_stream_cache=Module["_flatsql_configure_raw_stream_cache"]=wasmExports["Nb"];_flatsql_raw_stream_cache_hits=Module["_flatsql_raw_stream_cache_hits"]=wasmExports["Ob"];_flatsql_raw_stream_cache_misses=Module["_flatsql_raw_stream_cache_misses"]=wasmExports["Pb"];_flatsql_raw_stream_cache_size=Module["_flatsql_raw_stream_cache_size"]=wasmExports["Qb"];_flatsql_raw_stream_cache_total_bytes=Module["_flatsql_raw_stream_cache_total_bytes"]=wasmExports["Rb"];_flatsql_response_artifact_row_count=Module["_flatsql_response_artifact_row_count"]=wasmExports["Sb"];_flatsql_response_artifact_column_count=Module["_flatsql_response_artifact_column_count"]=wasmExports["Tb"];_flatsql_export_size=Module["_flatsql_export_size"]=wasmExports["Ub"];_flatsql_load_and_rebuild=Module["_flatsql_load_and_rebuild"]=wasmExports["Vb"];_flatsql_reserve_storage=Module["_flatsql_reserve_storage"]=wasmExports["Wb"];_flatsql_load_from_db=Module["_flatsql_load_from_db"]=wasmExports["Xb"];_flatsql_create_test_user=Module["_flatsql_create_test_user"]=wasmExports["Yb"];_flatsql_test_buffer_size=Module["_flatsql_test_buffer_size"]=wasmExports["Zb"];_flatsql_create_test_post=Module["_flatsql_create_test_post"]=wasmExports["_b"];_flatsql_create_test_mpe=Module["_flatsql_create_test_mpe"]=wasmExports["$b"];_flatsql_create_test_telemetry=Module["_flatsql_create_test_telemetry"]=wasmExports["ac"];_flatsql_create_test_publish_event=Module["_flatsql_create_test_publish_event"]=wasmExports["bc"];_flatsql_get_stats_count=Module["_flatsql_get_stats_count"]=wasmExports["cc"];_flatsql_get_stat_table_name=Module["_flatsql_get_stat_table_name"]=wasmExports["dc"];_flatsql_get_stat_file_id=Module["_flatsql_get_stat_file_id"]=wasmExports["ec"];_flatsql_get_stat_record_count=Module["_flatsql_get_stat_record_count"]=wasmExports["fc"];_flatsql_reset_ingest_profile=Module["_flatsql_reset_ingest_profile"]=wasmExports["gc"];_flatsql_get_ingest_profile_record_count=Module["_flatsql_get_ingest_profile_record_count"]=wasmExports["hc"];_flatsql_get_ingest_profile_byte_count=Module["_flatsql_get_ingest_profile_byte_count"]=wasmExports["ic"];_flatsql_get_ingest_profile_decode_nanos=Module["_flatsql_get_ingest_profile_decode_nanos"]=wasmExports["jc"];_flatsql_get_ingest_profile_append_nanos=Module["_flatsql_get_ingest_profile_append_nanos"]=wasmExports["kc"];_flatsql_get_ingest_profile_index_nanos=Module["_flatsql_get_ingest_profile_index_nanos"]=wasmExports["lc"];_flatsql_mark_deleted=Module["_flatsql_mark_deleted"]=wasmExports["mc"];_flatsql_get_deleted_count=Module["_flatsql_get_deleted_count"]=wasmExports["nc"];_flatsql_clear_tombstones=Module["_flatsql_clear_tombstones"]=wasmExports["oc"];_flatsql_get_sources_count=Module["_flatsql_get_sources_count"]=wasmExports["pc"];_flatsql_get_source_name=Module["_flatsql_get_source_name"]=wasmExports["qc"];_flatsql_get_flatbuffer_by_id=Module["_flatsql_get_flatbuffer_by_id"]=wasmExports["rc"];_flatsql_get_flatbuffer_by_email=Module["_flatsql_get_flatbuffer_by_email"]=wasmExports["sc"];_flatsql_get_flatbuffer_by_index=Module["_flatsql_get_flatbuffer_by_index"]=wasmExports["tc"];_flatsql_get_raw_flatbuffer_size=Module["_flatsql_get_raw_flatbuffer_size"]=wasmExports["uc"];_flatsql_get_raw_flatbuffer_sequence=Module["_flatsql_get_raw_flatbuffer_sequence"]=wasmExports["vc"];_flatsql_get_storage_buffer=Module["_flatsql_get_storage_buffer"]=wasmExports["wc"];_flatsql_get_storage_size=Module["_flatsql_get_storage_size"]=wasmExports["xc"];_flatsql_set_encryption_key=Module["_flatsql_set_encryption_key"]=wasmExports["yc"];_flatsql_is_encrypted=Module["_flatsql_is_encrypted"]=wasmExports["zc"];_flatsql_encrypt_buffer=Module["_flatsql_encrypt_buffer"]=wasmExports["Ac"];_flatsql_decrypt_buffer=Module["_flatsql_decrypt_buffer"]=wasmExports["Bc"];_flatsql_set_hmac_verification=Module["_flatsql_set_hmac_verification"]=wasmExports["Cc"];_flatsql_is_hmac_enabled=Module["_flatsql_is_hmac_enabled"]=wasmExports["Dc"];_flatsql_compute_hmac=Module["_flatsql_compute_hmac"]=wasmExports["Ec"];_flatsql_verify_hmac=Module["_flatsql_verify_hmac"]=wasmExports["Fc"];_setThrew=wasmExports["Gc"];__emscripten_tempret_set=wasmExports["Hc"];__emscripten_stack_restore=wasmExports["Ic"];__emscripten_stack_alloc=wasmExports["Jc"];_emscripten_stack_get_current=wasmExports["Kc"];___cxa_decrement_exception_refcount=wasmExports["Lc"];___cxa_increment_exception_refcount=wasmExports["Mc"];___cxa_can_catch=wasmExports["Nc"];___cxa_get_exception_ptr=wasmExports["Oc"];dynCall_v=wasmExports["Pc"];dynCall_ii=wasmExports["Qc"];dynCall_iii=wasmExports["Rc"];dynCall_viiiiii=wasmExports["Sc"];dynCall_vii=wasmExports["Tc"];dynCall_viii=wasmExports["Uc"];dynCall_iiii=wasmExports["Vc"];dynCall_iiiiii=wasmExports["Wc"];dynCall_vi=wasmExports["Xc"];dynCall_viiii=wasmExports["Yc"];dynCall_jii=wasmExports["Zc"];dynCall_viiiii=wasmExports["_c"];dynCall_iiiiiii=wasmExports["$c"];dynCall_iiiii=wasmExports["ad"];dynCall_iiij=wasmExports["bd"];dynCall_iiid=wasmExports["cd"];dynCall_viijij=wasmExports["dd"];dynCall_viiijj=wasmExports["ed"];dynCall_jiiiii=wasmExports["fd"];dynCall_iiiiiiiiiiii=wasmExports["gd"];dynCall_vij=wasmExports["hd"];dynCall_iiji=wasmExports["id"];dynCall_iijiii=wasmExports["jd"];dynCall_viijj=wasmExports["kd"];dynCall_viij=wasmExports["ld"];dynCall_iid=wasmExports["md"];dynCall_i=wasmExports["nd"];dynCall_dii=wasmExports["od"];dynCall_di=wasmExports["pd"];dynCall_iiiid=wasmExports["qd"];dynCall_iij=wasmExports["rd"];dynCall_viidi=wasmExports["sd"];dynCall_vid=wasmExports["td"];dynCall_vidd=wasmExports["dynCall_vidd"];dynCall_dd=wasmExports["dynCall_dd"];dynCall_ddd=wasmExports["dynCall_ddd"];dynCall_jiiii=wasmExports["ud"];dynCall_viiiiiiii=wasmExports["vd"];dynCall_iiiddddddddi=wasmExports["wd"];dynCall_iiiij=wasmExports["dynCall_iiiij"];dynCall_iijj=wasmExports["dynCall_iijj"];dynCall_iijii=wasmExports["dynCall_iijii"];dynCall_iidiiii=wasmExports["dynCall_iidiiii"];dynCall_j=wasmExports["xd"];dynCall_iiiiid=wasmExports["yd"];dynCall_viijii=wasmExports["dynCall_viijii"];dynCall_iiiiiiii=wasmExports["zd"];dynCall_iiiiiiiiiii=wasmExports["dynCall_iiiiiiiiiii"];dynCall_iiiiiiiiiiiii=wasmExports["dynCall_iiiiiiiiiiiii"];dynCall_fiii=wasmExports["Ad"];dynCall_diii=wasmExports["Bd"];dynCall_viiiiiii=wasmExports["Cd"];dynCall_viiiiiiiiii=wasmExports["Dd"];dynCall_viiiiiiiiiiiiiii=wasmExports["Ed"];dynCall_iiiiiiiii=wasmExports["dynCall_iiiiiiiii"];dynCall_iiiiij=wasmExports["dynCall_iiiiij"];dynCall_iiiiijj=wasmExports["dynCall_iiiiijj"];dynCall_iiiiiijj=wasmExports["dynCall_iiiiiijj"];memory=wasmMemory=wasmExports["Na"];__indirect_function_table=wasmTable=wasmExports["Pa"]}var wasmImports={k:___cxa_begin_catch,r:___cxa_end_catch,a:___cxa_find_matching_catch_2,e:___cxa_find_matching_catch_3,v:___cxa_find_matching_catch_4,Z:___cxa_rethrow,o:___cxa_throw,ea:___cxa_uncaught_exceptions,d:___resumeException,Ea:___syscall_chmod,Ga:___syscall_faccessat,Fa:___syscall_fchmod,Da:___syscall_fchown32,z:___syscall_fcntl64,Ca:___syscall_fstat64,xa:___syscall_ftruncate64,wa:___syscall_getcwd,za:___syscall_lstat64,sa:___syscall_mkdirat,Aa:___syscall_newfstatat,oa:___syscall_openat,ma:___syscall_readlinkat,la:___syscall_rmdir,Ba:___syscall_stat64,ja:___syscall_unlinkat,ia:___syscall_utimensat,ca:__abort_js,qa:__localtime_js,ra:__tzset_js,pa:_clock_time_get,P:_emscripten_date_now,O:_emscripten_get_now,ga:_emscripten_resize_heap,ua:_environ_get,va:_environ_sizes_get,Q:_fd_close,ha:_fd_fdstat_get,na:_fd_read,ta:_fd_seek,ya:_fd_sync,ka:_fd_write,V:_flatsql_io_close,A:_flatsql_io_open,X:_flatsql_io_read,Y:_flatsql_io_size,S:_flatsql_io_sync,Ha:_flatsql_io_truncate,T:_flatsql_io_write,x:invoke_di,H:invoke_dii,K:invoke_diii,M:invoke_fiii,t:invoke_i,c:invoke_ii,L:invoke_iid,g:invoke_iii,I:invoke_iiid,Ia:invoke_iiiddddddddi,h:invoke_iiii,W:invoke_iiiid,m:invoke_iiiii,da:invoke_iiiiid,n:invoke_iiiiii,s:invoke_iiiiiii,N:invoke_iiiiiiii,E:invoke_iiiiiiiiiiii,Ma:invoke_iiij,U:invoke_iij,C:invoke_iiji,Ka:invoke_iijiii,fa:invoke_j,J:invoke_jii,D:invoke_jiiii,$:invoke_jiiiii,f:invoke_v,l:invoke_vi,G:invoke_vid,b:invoke_vii,R:invoke_viidi,i:invoke_viii,j:invoke_viiii,u:invoke_viiiii,q:invoke_viiiiii,w:invoke_viiiiiii,Ja:invoke_viiiiiiii,B:invoke_viiiiiiiiii,F:invoke_viiiiiiiiiiiiiii,aa:invoke_viiijj,ba:invoke_viij,La:invoke_viijij,_:invoke_viijj,y:invoke_vij,p:_llvm_eh_typeid_for};function invoke_v(index){var sp=stackSave();try{dynCall_v(index)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_ii(index,a1){var sp=stackSave();try{return dynCall_ii(index,a1)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iii(index,a1,a2){var sp=stackSave();try{return dynCall_iii(index,a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{dynCall_viiiiii(index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vii(index,a1,a2){var sp=stackSave();try{dynCall_vii(index,a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vij(index,a1,a2){var sp=stackSave();try{dynCall_vij(index,a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiii(index,a1,a2,a3){var sp=stackSave();try{return dynCall_iiii(index,a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viii(index,a1,a2,a3){var sp=stackSave();try{dynCall_viii(index,a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return dynCall_iiiiii(index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vi(index,a1){var sp=stackSave();try{dynCall_vi(index,a1)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiii(index,a1,a2,a3,a4){var sp=stackSave();try{dynCall_viiii(index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_jii(index,a1,a2){var sp=stackSave();try{return dynCall_jii(index,a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);return 0n}}function invoke_viiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{dynCall_viiiii(index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{return dynCall_iiiiiii(index,a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return dynCall_iiiii(index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiij(index,a1,a2,a3){var sp=stackSave();try{return dynCall_iiij(index,a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiid(index,a1,a2,a3){var sp=stackSave();try{return dynCall_iiid(index,a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viijij(index,a1,a2,a3,a4,a5){var sp=stackSave();try{dynCall_viijij(index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viij(index,a1,a2,a3){var sp=stackSave();try{dynCall_viij(index,a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiijj(index,a1,a2,a3,a4,a5){var sp=stackSave();try{dynCall_viiijj(index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_jiiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return dynCall_jiiiii(index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);return 0n}}function invoke_iiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){var sp=stackSave();try{return dynCall_iiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiji(index,a1,a2,a3){var sp=stackSave();try{return dynCall_iiji(index,a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iijiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return dynCall_iijiii(index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viijj(index,a1,a2,a3,a4){var sp=stackSave();try{dynCall_viijj(index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{dynCall_viiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iid(index,a1,a2){var sp=stackSave();try{return dynCall_iid(index,a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_i(index){var sp=stackSave();try{return dynCall_i(index)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_dii(index,a1,a2){var sp=stackSave();try{return dynCall_dii(index,a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_di(index,a1){var sp=stackSave();try{return dynCall_di(index,a1)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiid(index,a1,a2,a3,a4){var sp=stackSave();try{return dynCall_iiiid(index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iij(index,a1,a2){var sp=stackSave();try{return dynCall_iij(index,a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viidi(index,a1,a2,a3,a4){var sp=stackSave();try{dynCall_viidi(index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vid(index,a1,a2){var sp=stackSave();try{dynCall_vid(index,a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_jiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return dynCall_jiiii(index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);return 0n}}function invoke_viiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8){var sp=stackSave();try{dynCall_viiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiddddddddi(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){var sp=stackSave();try{return dynCall_iiiddddddddi(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_j(index){var sp=stackSave();try{return dynCall_j(index)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0);return 0n}}function invoke_iiiiid(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return dynCall_iiiiid(index,a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{return dynCall_iiiiiiii(index,a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_fiii(index,a1,a2,a3){var sp=stackSave();try{return dynCall_fiii(index,a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_diii(index,a1,a2,a3){var sp=stackSave();try{return dynCall_diii(index,a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{dynCall_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15){var sp=stackSave();try{dynCall_viiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function applySignatureConversions(wasmExports){wasmExports=Object.assign({},wasmExports);var makeWrapper_pp=f=>a0=>f(a0)>>>0;var makeWrapper_p=f=>()=>f()>>>0;wasmExports["Ra"]=makeWrapper_pp(wasmExports["Ra"]);wasmExports["Jc"]=makeWrapper_pp(wasmExports["Jc"]);wasmExports["Kc"]=makeWrapper_p(wasmExports["Kc"]);wasmExports["Oc"]=makeWrapper_pp(wasmExports["Oc"]);return wasmExports}function run(){preRun();function doRun(){Module["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve?.(Module);Module["onRuntimeInitialized"]?.();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(()=>{setTimeout(()=>Module["setStatus"](""),1);doRun()},1)}else{doRun()}}var wasmExports;wasmExports=await (createWasm());run();if(runtimeInitialized){moduleRtn=Module}else{moduleRtn=new Promise((resolve,reject)=>{readyPromiseResolve=resolve;readyPromiseReject=reject})}
2
2
  ;return moduleRtn}export default FlatSQL;
package/wasm/flatsql.wasm CHANGED
Binary file
package/wasm/index.d.ts CHANGED
@@ -3,6 +3,10 @@
3
3
  * SQL queries over raw FlatBuffer storage
4
4
  */
5
5
 
6
+ import type { FlatSqlIoBackend } from './flatsql-io.js';
7
+
8
+ export type { FlatSqlIoBackend };
9
+
6
10
  export interface QueryResult {
7
11
  columns: string[];
8
12
  rows: any[][];
@@ -459,6 +463,17 @@ export interface InitOptions {
459
463
  data: ArrayBuffer
460
464
  ) => Promise<string | Uint8Array | ArrayBuffer> | string | Uint8Array | ArrayBuffer;
461
465
 
466
+ /**
467
+ * Host I/O backend for disk-backed databases — the seven-import contract in
468
+ * cpp/include/flatsql/flatsql_io.h, which the runtime has always read off
469
+ * this option (wasm/index.js: `ioBackend = options.io ?? null`).
470
+ *
471
+ * Declared here because a runtime option missing from the published types is
472
+ * a contract that every TypeScript caller has to defeat with a cast, and a
473
+ * cast is where drift starts. Use `flatsql/io` for the backends.
474
+ */
475
+ io?: FlatSqlIoBackend;
476
+
462
477
  /**
463
478
  * Custom Emscripten module factory function
464
479
  * Default: built-in FlatSQLModule
@@ -622,6 +622,30 @@ export class FlatSQLStandaloneDatabase {
622
622
  this._runtime.exports.flatsql_enable_demo_extractors(this._handle);
623
623
  }
624
624
 
625
+ // Source partitions. The artifact has always exported these; the shim did
626
+ // not wrap them, so the wasm lane could ingest WITH a source but never
627
+ // declare one, and could not see what a reopen restored. Same three calls,
628
+ // same names, same order as wasm/index.js — one engine, one surface.
629
+ registerSource(sourceName) {
630
+ this._runtime.withCString(sourceName, (ptr) =>
631
+ this._runtime.exports.flatsql_register_source(this._handle, ptr)
632
+ );
633
+ }
634
+
635
+ createUnifiedViews() {
636
+ this._runtime.exports.flatsql_create_unified_views(this._handle);
637
+ }
638
+
639
+ listSources() {
640
+ const count = this._runtime.exports.flatsql_get_sources_count(this._handle);
641
+ const sources = [];
642
+ for (let i = 0; i < count; i++) {
643
+ const ptr = this._runtime.exports.flatsql_get_source_name(i);
644
+ sources.push(ptr ? this._runtime.readCString(ptr) : '');
645
+ }
646
+ return sources;
647
+ }
648
+
625
649
  ingest(data, source = null) {
626
650
  return this._runtime.withBytes(data, (ptr) => {
627
651
  if (source) {