Skip to content

Commit e74c7ab

Browse files
authored
Merge pull request #83 from louwers/binding-spec
Add `undefined` and `boolean` to `BindingSpec` type
2 parents 0fa5393 + a061bd2 commit e74c7ab

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

index.d.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ declare type SqlValue =
88
| Int8Array
99
| ArrayBuffer;
1010

11+
/** Types of values that can be passed to SQLite. */
12+
declare type BindableValue =
13+
| SqlValue
14+
/** converted to NULL */
15+
| undefined
16+
/** converted to INTEGER */
17+
| boolean;
18+
1119
/** Internal data types supported by SQLite3. */
1220
declare type SQLiteDataType =
1321
| CAPI['SQLITE_INTEGER']
@@ -18,10 +26,10 @@ declare type SQLiteDataType =
1826

1927
/** Specifies parameter bindings. */
2028
declare type BindingSpec =
21-
| readonly SqlValue[]
22-
| { [paramName: string]: SqlValue }
29+
| readonly BindableValue[]
30+
| { [paramName: string]: BindableValue }
2331
/** Assumed to have binding index `1` */
24-
| SqlValue;
32+
| (SqlValue | boolean);
2533

2634
/**
2735
* Certain WASM-bound APIs, where explicitly noted, have additional string-type

0 commit comments

Comments
 (0)