Skip to content

Commit 779b900

Browse files
committed
Merge branch 'main' into chore/promiser-types
2 parents 0a22a1f + 2adc35d commit 779b900

1 file changed

Lines changed: 186 additions & 1 deletion

File tree

src/index.d.ts

Lines changed: 186 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4671,6 +4671,31 @@ export type CAPI = {
46714671
*/
46724672
sqlite3_stmt_isexplain: (stmt: StmtPtr) => 0 | 1 | 2;
46734673

4674+
/**
4675+
* Set the explain mode for a statement.
4676+
*
4677+
* C Signature:
4678+
*
4679+
* int sqlite3_stmt_explain(sqlite3_stmt *pStmt, int eMode);
4680+
*
4681+
* See https://sqlite.org/c3ref/stmt_explain.html
4682+
*/
4683+
sqlite3_stmt_explain: (stmt: StmtPtr, eMode: number) => Sqlite3Result;
4684+
4685+
/**
4686+
* Return a pointer to the next prepared statement after `pStmt` associated
4687+
* with database connection `db`. If `pStmt` is null, return the first
4688+
* prepared statement for the database connection. Return 0 if there are no
4689+
* more.
4690+
*
4691+
* C Signature:
4692+
*
4693+
* sqlite3_stmt * sqlite3_next_stmt(sqlite3 * pDb, sqlite3_stmt * pStmt);
4694+
*
4695+
* See https://sqlite.org/c3ref/next_stmt.html
4696+
*/
4697+
sqlite3_next_stmt: (db: DbPtr, pStmt: StmtPtr | 0) => StmtPtr | 0;
4698+
46744699
/**
46754700
* Bind a `BLOB` value to a parameter in a prepared statement.
46764701
*
@@ -4910,6 +4935,39 @@ export type CAPI = {
49104935
*/
49114936
sqlite3_column_decltype: (stmt: StmtPtr, N: number) => string | null;
49124937

4938+
/**
4939+
* Return the name of the database from which a result column derives. Returns
4940+
* null if the column is not an unambiguous reference to a database column.
4941+
*
4942+
* C Signature:
4943+
*
4944+
* const char *sqlite3_column_database_name(sqlite3_stmt *pStmt, int N);
4945+
*/
4946+
sqlite3_column_database_name: (stmt: StmtPtr, N: number) => string | null;
4947+
4948+
/**
4949+
* Return the name of the table from which a result column derives. Returns
4950+
* null if the column is not an unambiguous reference to a database column.
4951+
*
4952+
* C Signature:
4953+
*
4954+
* const char *sqlite3_column_table_name(sqlite3_stmt *pStmt, int N);
4955+
*
4956+
* See https://sqlite.org/c3ref/column_database_name.html
4957+
*/
4958+
sqlite3_column_table_name: (stmt: StmtPtr, N: number) => string | null;
4959+
4960+
/**
4961+
* Return the name of the table column from which a result column derives.
4962+
* Returns null if the column is not an unambiguous reference to a database
4963+
* column.
4964+
*
4965+
* C Signature:
4966+
*
4967+
* const char *sqlite3_column_origin_name(sqlite3_stmt *pStmt, int N);
4968+
*/
4969+
sqlite3_column_origin_name: (stmt: StmtPtr, N: number) => string | null;
4970+
49134971
/**
49144972
* Returns the result of passing the result of
49154973
* `sqlite3_column_value(pStmt,iCol)` to `sqlite3_value_to_js()`. The 3rd
@@ -6422,6 +6480,44 @@ export type CAPI = {
64226480
resetFlag: number,
64236481
) => Sqlite3Result;
64246482

6483+
/**
6484+
* Used to retrieve runtime status information about a single database
6485+
* connection with 64-bit counters.
6486+
*
6487+
* C Signature:
6488+
*
6489+
* int sqlite3_db_status64(
6490+
* sqlite3 *db,
6491+
* int op,
6492+
* sqlite3_int64 *pCurrent,
6493+
* sqlite3_int64 *pHighwtr,
6494+
* int resetFlag
6495+
* );
6496+
*
6497+
* See https://www.sqlite.org/c3ref/db_status.html
6498+
*/
6499+
sqlite3_db_status64: (
6500+
db: DbPtr,
6501+
op:
6502+
| CAPI['SQLITE_DBSTATUS_LOOKASIDE_USED']
6503+
| CAPI['SQLITE_DBSTATUS_CACHE_USED']
6504+
| CAPI['SQLITE_DBSTATUS_SCHEMA_USED']
6505+
| CAPI['SQLITE_DBSTATUS_STMT_USED']
6506+
| CAPI['SQLITE_DBSTATUS_LOOKASIDE_HIT']
6507+
| CAPI['SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE']
6508+
| CAPI['SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL']
6509+
| CAPI['SQLITE_DBSTATUS_CACHE_HIT']
6510+
| CAPI['SQLITE_DBSTATUS_CACHE_MISS']
6511+
| CAPI['SQLITE_DBSTATUS_CACHE_WRITE']
6512+
| CAPI['SQLITE_DBSTATUS_DEFERRED_FKS']
6513+
| CAPI['SQLITE_DBSTATUS_CACHE_USED_SHARED']
6514+
| CAPI['SQLITE_DBSTATUS_CACHE_SPILL']
6515+
| CAPI['SQLITE_DBSTATUS_MAX'],
6516+
pCurrent: WasmPointer,
6517+
pHighwtr: WasmPointer,
6518+
resetFlag: number,
6519+
) => Sqlite3Result;
6520+
64256521
/**
64266522
* Retrieve and reset counter values from a prepared statement.
64276523
*
@@ -7655,7 +7751,7 @@ export type CAPI = {
76557751
* int flags
76567752
* );
76577753
*
7658-
* See https://www.sqlite.org/c3ref/changeset_apply.html
7754+
* See https://sqlite.org/session/sqlite3changeset_apply.html
76597755
*
76607756
* @param db Apply change to `"main"` db of this handle
76617757
* @param nChangeset Size of changeset blob in bytes
@@ -7693,6 +7789,53 @@ export type CAPI = {
76937789
flags: number,
76947790
) => Sqlite3Result;
76957791

7792+
/**
7793+
* Apply a changeset or patchset to a database (V3 variant). This is like
7794+
* `sqlite3changeset_apply_v2()` but the filter callback is invoked once per
7795+
* change and receives an iterator handle for the current change.
7796+
*
7797+
* C Signature:
7798+
*
7799+
* int sqlite3changeset_apply_v3(
7800+
* sqlite3 *db,
7801+
* int nChangeset,
7802+
* void *pChangeset,
7803+
* int(*xFilter)(void *pCtx, sqlite3_changeset_iter *p),
7804+
* int (*xConflict)(void *pCtx, int eConflict, sqlite3_changeset_iter *p),
7805+
* void *pCtx,
7806+
* void **ppRebase,
7807+
* int *pnRebase,
7808+
* int flags
7809+
* );
7810+
*
7811+
* See https://sqlite.org/session/sqlite3changeset_apply.html
7812+
*/
7813+
sqlite3changeset_apply_v3: (
7814+
db: DbPtr,
7815+
nChangeset: number,
7816+
pChangeset: WasmPointer,
7817+
xFilter: ((pCtx: WasmPointer, pIter: WasmPointer) => number) | WasmPointer,
7818+
xConflict:
7819+
| ((
7820+
pCtx: WasmPointer,
7821+
eConflict:
7822+
| CAPI['SQLITE_CHANGESET_DATA']
7823+
| CAPI['SQLITE_CHANGESET_NOTFOUND']
7824+
| CAPI['SQLITE_CHANGESET_CONFLICT']
7825+
| CAPI['SQLITE_CHANGESET_FOREIGN_KEY']
7826+
| CAPI['SQLITE_CHANGESET_CONSTRAINT'],
7827+
pIter: WasmPointer,
7828+
) =>
7829+
| CAPI['SQLITE_CHANGESET_OMIT']
7830+
| CAPI['SQLITE_CHANGESET_ABORT']
7831+
| CAPI['SQLITE_CHANGESET_REPLACE'])
7832+
| WasmPointer,
7833+
pCtx: WasmPointer,
7834+
ppRebase: WasmPointer,
7835+
pnRebase: WasmPointer,
7836+
flags: number,
7837+
) => Sqlite3Result;
7838+
76967839
/**
76977840
* Streaming version of `sqlite3changeset_apply()`.
76987841
*
@@ -7790,6 +7933,48 @@ export type CAPI = {
77907933
flags: number,
77917934
) => Sqlite3Result;
77927935

7936+
/**
7937+
* Streaming version of `sqlite3changeset_apply_v3()`.
7938+
*
7939+
* C Signature:
7940+
*
7941+
* int sqlite3changeset_apply_v3_strm(
7942+
* sqlite3 *db,
7943+
* int (*xInput)(void *pIn, void *pData, int *pnData),
7944+
* void *pIn,
7945+
* int(*xFilter)(void *pCtx, sqlite3_changeset_iter *p),
7946+
* int (*xConflict)(void *pCtx, int eConflict, sqlite3_changeset_iter *p),
7947+
* void *pCtx,
7948+
* void **ppRebase, int *pnRebase,
7949+
* int flags
7950+
* );
7951+
*
7952+
* See https://sqlite.org/session/sqlite3changeset_apply.html
7953+
*/
7954+
sqlite3changeset_apply_v3_strm: (
7955+
db: DbPtr,
7956+
xInput:
7957+
| ((pIn: WasmPointer, pData: WasmPointer, pnData: WasmPointer) => number)
7958+
| WasmPointer,
7959+
pIn: WasmPointer,
7960+
xFilter: ((pCtx: WasmPointer, pIter: WasmPointer) => number) | WasmPointer,
7961+
xConflict:
7962+
| ((
7963+
pCtx: WasmPointer,
7964+
eConflict:
7965+
| CAPI['SQLITE_CHANGESET_DATA']
7966+
| CAPI['SQLITE_CHANGESET_NOTFOUND']
7967+
| CAPI['SQLITE_CHANGESET_CONFLICT']
7968+
| CAPI['SQLITE_CHANGESET_FOREIGN_KEY']
7969+
| CAPI['SQLITE_CHANGESET_CONSTRAINT'],
7970+
) => number)
7971+
| WasmPointer,
7972+
pCtx: WasmPointer,
7973+
ppRebase: WasmPointer,
7974+
pnRebase: WasmPointer,
7975+
flags: number,
7976+
) => Sqlite3Result;
7977+
77937978
/**
77947979
* Streaming version of `sqlite3changeset_concat()`.
77957980
*

0 commit comments

Comments
 (0)