Merge pull request #31477 from Loghorn/better-sqlite3-5.2

Add new better-sqlite3 v5.2 methods
This commit is contained in:
Nathan Shively-Sanders
2018-12-18 13:58:15 -08:00
committed by GitHub
2 changed files with 19 additions and 1 deletions
@@ -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');
+11 -1
View File
@@ -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;