mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
Merge pull request #31477 from Loghorn/better-sqlite3-5.2
Add new better-sqlite3 v5.2 methods
This commit is contained in:
@@ -53,6 +53,14 @@ stmt.expand(true);
|
||||
stmt.bind('name');
|
||||
stmt.safeIntegers();
|
||||
stmt.safeIntegers(true);
|
||||
stmt.raw();
|
||||
stmt.raw(true);
|
||||
stmt.raw(false);
|
||||
for (const col of stmt.columns()) {
|
||||
col.name;
|
||||
col.column;
|
||||
col.type;
|
||||
}
|
||||
|
||||
const trans = db.transaction((param) => stmt.all(param));
|
||||
trans('name');
|
||||
|
||||
Vendored
+11
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for better-sqlite3 5.0
|
||||
// Type definitions for better-sqlite3 5.2
|
||||
// Project: http://github.com/JoshuaWise/better-sqlite3
|
||||
// Definitions by: Ben Davies <https://github.com/Morfent>
|
||||
// Mathew Rumsey <https://github.com/matrumz>
|
||||
@@ -19,10 +19,20 @@ interface Statement {
|
||||
iterate(...params: any[]): IterableIterator<any>;
|
||||
pluck(toggleState?: boolean): this;
|
||||
expand(toggleState?: boolean): this;
|
||||
raw(toggleState?: boolean): this;
|
||||
bind(...params: any[]): this;
|
||||
columns(): ColumnDefinition[];
|
||||
safeIntegers(toggleState?: boolean): this;
|
||||
}
|
||||
|
||||
interface ColumnDefinition {
|
||||
name: string;
|
||||
column: string | null;
|
||||
table: string | null;
|
||||
database: string | null;
|
||||
type: string | null;
|
||||
}
|
||||
|
||||
interface Transaction {
|
||||
(...params: any[]): any;
|
||||
default(...params: any[]): any;
|
||||
|
||||
Reference in New Issue
Block a user