Skip to content

Commit 4ab8b3c

Browse files
committed
Deploying to gh-pages from @ b645ca0 🚀
1 parent 2e54726 commit 4ab8b3c

13 files changed

+128
-80
lines changed

‎dist/sql-asm-debug.js

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1562,17 +1562,12 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() {
15621562
* // This won't trigger any callback
15631563
* db.run("INSERT INTO users VALUES (2, 'Bob', 1)");
15641564
*
1565-
* @param {function|null} callback -
1566-
* Callback to be executed whenever a row changes.
1567-
* Set to `null` to unregister the callback.
1568-
* @param {string} callback.operation -
1569-
* 'insert', 'update', or 'delete'
1570-
* @param {string} callback.database -
1571-
* database where the change occurred
1572-
* @param {string} callback.table -
1573-
* table where the change occurred
1574-
* @param {number} callback.rowId -
1575-
* rowid of the changed row
1565+
* @param {Database~UpdateHookCallback|null} callback
1566+
* - Callback to be executed when a row changes. Takes the type of change,
1567+
* the name of the database, the name of the table, and the row id of the
1568+
* changed row.
1569+
* - Set to `null` to unregister.
1570+
* @returns {Database} The database object. Useful for method chaining
15761571
*/
15771572
Database.prototype["updateHook"] = function updateHook(callback) {
15781573
if (this.updateHookFunctionPtr) {
@@ -1584,7 +1579,7 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() {
15841579

15851580
if (!callback) {
15861581
// no new callback to register
1587-
return;
1582+
return this;
15881583
}
15891584

15901585
// void(*)(void *,int ,char const *,char const *,sqlite3_int64)
@@ -1631,8 +1626,21 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() {
16311626
this.updateHookFunctionPtr,
16321627
0 // passed as the first arg to wrappedCallback
16331628
);
1629+
return this;
16341630
};
16351631

1632+
/**
1633+
* @callback Database~UpdateHookCallback
1634+
* @param {'insert'|'update'|'delete'} operation
1635+
* - The type of change that occurred
1636+
* @param {string} database
1637+
* - The name of the database where the change occurred
1638+
* @param {string} table
1639+
* - The name of the database's table where the change occurred
1640+
* @param {number} rowId
1641+
* - The [rowid](https://www.sqlite.org/rowidtable.html) of the changed row
1642+
*/
1643+
16361644
// export Database to Module
16371645
Module.Database = Database;
16381646
};

‎dist/sql-asm-memory-growth.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/sql-asm.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/sql-wasm-debug.js

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1562,17 +1562,12 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() {
15621562
* // This won't trigger any callback
15631563
* db.run("INSERT INTO users VALUES (2, 'Bob', 1)");
15641564
*
1565-
* @param {function|null} callback -
1566-
* Callback to be executed whenever a row changes.
1567-
* Set to `null` to unregister the callback.
1568-
* @param {string} callback.operation -
1569-
* 'insert', 'update', or 'delete'
1570-
* @param {string} callback.database -
1571-
* database where the change occurred
1572-
* @param {string} callback.table -
1573-
* table where the change occurred
1574-
* @param {number} callback.rowId -
1575-
* rowid of the changed row
1565+
* @param {Database~UpdateHookCallback|null} callback
1566+
* - Callback to be executed when a row changes. Takes the type of change,
1567+
* the name of the database, the name of the table, and the row id of the
1568+
* changed row.
1569+
* - Set to `null` to unregister.
1570+
* @returns {Database} The database object. Useful for method chaining
15761571
*/
15771572
Database.prototype["updateHook"] = function updateHook(callback) {
15781573
if (this.updateHookFunctionPtr) {
@@ -1584,7 +1579,7 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() {
15841579

15851580
if (!callback) {
15861581
// no new callback to register
1587-
return;
1582+
return this;
15881583
}
15891584

15901585
// void(*)(void *,int ,char const *,char const *,sqlite3_int64)
@@ -1631,8 +1626,21 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() {
16311626
this.updateHookFunctionPtr,
16321627
0 // passed as the first arg to wrappedCallback
16331628
);
1629+
return this;
16341630
};
16351631

1632+
/**
1633+
* @callback Database~UpdateHookCallback
1634+
* @param {'insert'|'update'|'delete'} operation
1635+
* - The type of change that occurred
1636+
* @param {string} database
1637+
* - The name of the database where the change occurred
1638+
* @param {string} table
1639+
* - The name of the database's table where the change occurred
1640+
* @param {number} rowId
1641+
* - The [rowid](https://www.sqlite.org/rowidtable.html) of the changed row
1642+
*/
1643+
16361644
// export Database to Module
16371645
Module.Database = Database;
16381646
};

‎dist/sql-wasm.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/worker.sql-asm-debug.js

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1562,17 +1562,12 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() {
15621562
* // This won't trigger any callback
15631563
* db.run("INSERT INTO users VALUES (2, 'Bob', 1)");
15641564
*
1565-
* @param {function|null} callback -
1566-
* Callback to be executed whenever a row changes.
1567-
* Set to `null` to unregister the callback.
1568-
* @param {string} callback.operation -
1569-
* 'insert', 'update', or 'delete'
1570-
* @param {string} callback.database -
1571-
* database where the change occurred
1572-
* @param {string} callback.table -
1573-
* table where the change occurred
1574-
* @param {number} callback.rowId -
1575-
* rowid of the changed row
1565+
* @param {Database~UpdateHookCallback|null} callback
1566+
* - Callback to be executed when a row changes. Takes the type of change,
1567+
* the name of the database, the name of the table, and the row id of the
1568+
* changed row.
1569+
* - Set to `null` to unregister.
1570+
* @returns {Database} The database object. Useful for method chaining
15761571
*/
15771572
Database.prototype["updateHook"] = function updateHook(callback) {
15781573
if (this.updateHookFunctionPtr) {
@@ -1584,7 +1579,7 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() {
15841579

15851580
if (!callback) {
15861581
// no new callback to register
1587-
return;
1582+
return this;
15881583
}
15891584

15901585
// void(*)(void *,int ,char const *,char const *,sqlite3_int64)
@@ -1631,8 +1626,21 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() {
16311626
this.updateHookFunctionPtr,
16321627
0 // passed as the first arg to wrappedCallback
16331628
);
1629+
return this;
16341630
};
16351631

1632+
/**
1633+
* @callback Database~UpdateHookCallback
1634+
* @param {'insert'|'update'|'delete'} operation
1635+
* - The type of change that occurred
1636+
* @param {string} database
1637+
* - The name of the database where the change occurred
1638+
* @param {string} table
1639+
* - The name of the database's table where the change occurred
1640+
* @param {number} rowId
1641+
* - The [rowid](https://www.sqlite.org/rowidtable.html) of the changed row
1642+
*/
1643+
16361644
// export Database to Module
16371645
Module.Database = Database;
16381646
};

0 commit comments

Comments
 (0)