Skip to content

Commit

Permalink
New release
Browse files Browse the repository at this point in the history
  • Loading branch information
tomayac committed May 21, 2024
1 parent 58f75fc commit a905c12
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 23 deletions.
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ const initializeSQLite = async () => {
log('Loading and initializing SQLite3 module...');

const promiser = await new Promise((resolve) => {
const _promiser = sqlite3Worker1Promiser({ onready: () => resolve(_promiser) });
const _promiser = sqlite3Worker1Promiser({
onready: () => resolve(_promiser),
});
});

log('Done initializing. Running demo...');
Expand All @@ -65,7 +67,7 @@ const initializeSQLite = async () => {
const { dbId } = openResponse;
log(
'OPFS is available, created persisted database at',
openResponse.result.filename.replace(/^file:(.*?)\?vfs=opfs$/, '$1')
openResponse.result.filename.replace(/^file:(.*?)\?vfs=opfs$/, '$1'),
);
// Your SQLite code here.
} catch (err) {
Expand Down Expand Up @@ -106,13 +108,14 @@ const error = console.error;

const start = (sqlite3) => {
log('Running SQLite3 version', sqlite3.version.libVersion);
const db = 'opfs' in sqlite3
? new sqlite3.oo1.OpfsDb('/mydb.sqlite3')
: new sqlite3.oo1.DB('/mydb.sqlite3', 'ct');
const db =
'opfs' in sqlite3
? new sqlite3.oo1.OpfsDb('/mydb.sqlite3')
: new sqlite3.oo1.DB('/mydb.sqlite3', 'ct');
log(
'opfs' in sqlite3
'opfs' in sqlite3
? `OPFS is available, created persisted database at ${db.filename}`
: `OPFS is not available, created transient database ${db.filename}`
: `OPFS is not available, created transient database ${db.filename}`,
);
// Your SQLite code here.
};
Expand Down
16 changes: 12 additions & 4 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2032,12 +2032,20 @@ declare type Sqlite3Static = {
installVfs: (obj: {
io?: {
struct: sqlite3_io_methods;
methods: { [K in keyof sqlite3_io_methods as K extends `x${string}` ? K : never]?: sqlite3_io_methods[K] };
methods: {
[K in keyof sqlite3_io_methods as K extends `x${string}`
? K
: never]?: sqlite3_io_methods[K];
};
applyArgcCheck?: boolean;
};
vfs?: {
struct: sqlite3_vfs;
methods: { [K in keyof sqlite3_vfs as K extends `x${string}` ? K : never]?: sqlite3_vfs[K] };
methods: {
[K in keyof sqlite3_vfs as K extends `x${string}`
? K
: never]?: sqlite3_vfs[K];
};
applyArgcCheck?: boolean;
name?: string;
asDefault?: boolean;
Expand Down Expand Up @@ -2800,7 +2808,7 @@ declare type WASM_API = {
poke32: (addr: WasmPointer, value: number) => WASM_API;

/** Equivalent to poke(X,Y,'i64') */
poke64: (addr: WasmPointer, value: number|bigint) => WASM_API;
poke64: (addr: WasmPointer, value: number | bigint) => WASM_API;

/** Equivalent to poke(X,Y,'f32') */
poke32f: (addr: WasmPointer, value: number) => WASM_API;
Expand Down Expand Up @@ -5737,7 +5745,7 @@ declare type CAPI = {
*
* See https://www.sqlite.org/c3ref/vfs_find.html
*/
sqlite3_vfs_find: (vfsName: string|null) => WasmPointer;
sqlite3_vfs_find: (vfsName: string | null) => WasmPointer;

/**
* Register a new VFS. Becomes the default if the makeDflt parameter is set.
Expand Down
20 changes: 10 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sqlite.org/sqlite-wasm",
"version": "3.45.3-build2",
"version": "3.45.3-build3",
"description": "SQLite Wasm conveniently wrapped as an ES Module.",
"keywords": [
"sqlite",
Expand Down Expand Up @@ -58,7 +58,7 @@
"module-workers-polyfill": "^0.3.2",
"node-fetch": "^3.3.2",
"prettier": "^3.2.5",
"publint": "^0.2.7",
"publint": "^0.2.8",
"prettier-plugin-jsdoc": "^1.3.0",
"shx": "^0.3.4"
}
Expand Down

0 comments on commit a905c12

Please sign in to comment.