You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Added partial BigInt support
Moved from es6 to support bigint
Changed from getNumber to getBigInt
Avoided blobal redeclaration of function/variables
Improved BigInt support, handled bind params for bigInt
Logical change on how big int is supported
BigInt is not fully supported at WASM level
Added config to enable and disable bigInt support
Added documentation
Changed var to const as per readme standard
* Changes as per PR comments
* Changes as per PR comments - future extension support
Copy file name to clipboardexpand all lines: README.md
+27
Original file line number
Diff line number
Diff line change
@@ -231,6 +231,33 @@ Example:
231
231
});
232
232
</script>
233
233
```
234
+
### Enabling BigInt support
235
+
If you need ```BigInt``` support, it is partially supported since most browsers now supports it including Safari.Binding ```BigInt``` is still not supported, only getting ```BigInt``` from the database is supported for now.
236
+
237
+
```html
238
+
<script>
239
+
conststmt=db.prepare("SELECT * FROM test");
240
+
constconfig= {useBigInt:true};
241
+
/*Pass optional config param to the get function*/
242
+
while (stmt.step()) console.log(stmt.get(null, config));
243
+
244
+
/*OR*/
245
+
constresult=db.exec("SELECT * FROM test", config);
246
+
console.log(results[0].values)
247
+
</script>
248
+
```
249
+
On WebWorker, you can just add ```config``` param before posting a message. With this, you wont have to pass config param on ```get``` function.
250
+
251
+
```html
252
+
<script>
253
+
worker.postMessage({
254
+
id:1,
255
+
action:"exec",
256
+
sql:"SELECT * FROM test",
257
+
config: {useBigInt:true}, /*Optional param*/
258
+
});
259
+
</script>
260
+
```
234
261
235
262
See [examples/GUI/gui.js](examples/GUI/gui.js) for a full working example.
0 commit comments