@sqlite.org/sqlite-wasm
Advanced tools
Comparing version 3.42.0-build2 to 3.42.0-build3
{ | ||
"name": "@sqlite.org/sqlite-wasm", | ||
"version": "3.42.0-build2", | ||
"version": "3.42.0-build3", | ||
"description": "SQLite Wasm conveniently wrapped as an ES Module.", | ||
@@ -35,3 +35,2 @@ "keywords": [ | ||
"scripts": { | ||
"prepare": "npm run build && npm run fix && npm run publint", | ||
"publint": "npx publint", | ||
@@ -42,2 +41,3 @@ "clean": "shx rm -rf sqlite-wasm", | ||
"fix": "npx prettier . --write", | ||
"prepare": "npm run build && npm run fix && npm run publint", | ||
"deploy": "npm run prepare && git add . && git commit -am 'New release' && git push && npm publish --access public" | ||
@@ -61,9 +61,9 @@ }, | ||
"node-fetch": "^3.3.1", | ||
"prettier": "^2.8.8", | ||
"publint": "^0.1.13", | ||
"prettier": "^3.0.0", | ||
"publint": "^0.1.16", | ||
"shx": "^0.3.4" | ||
}, | ||
"dependencies": { | ||
"optionalDependencies": { | ||
"comlink": "^4.4.1" | ||
} | ||
} |
@@ -102,2 +102,29 @@ # SQLite Wasm | ||
## Usage with the bundled `SQLiteClient` (with OPFS if available): | ||
> **Warning** For this to work, you need to set the following headers on your | ||
> server: | ||
> | ||
> `Cross-Origin-Opener-Policy: same-origin` | ||
> | ||
> `Cross-Origin-Embedder-Policy: require-corp` | ||
Import the `@sqlite.org/sqlite-wasm` library in your code and use it as such: | ||
```js | ||
import { SqliteClient } from '@sqlite.org/sqlite-wasm'; | ||
// Must correspond to the path in your final deployed build. | ||
const sqliteWorkerPath = 'assets/js/sqlite-worker.js'; | ||
// This is the name of your database. It corresponds to the path in the OPFS. | ||
const filename = '/test.sqlite3'; | ||
const sqlite = new Sqlite(filename, sqliteWorkerPath); | ||
await sqlite.init(); | ||
await sqlite.executeSql('CREATE TABLE IF NOT EXISTS test(a,b)'); | ||
await sqlite.executeSql('INSERT INTO test VALUES(?, ?)', [6, 7]); | ||
const results = await sqlite.executeSql('SELECT * FROM test'); | ||
``` | ||
## Usage with vite | ||
@@ -104,0 +131,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2704080
50382
184
- Removedcomlink@^4.4.1