Skip to content

Commit 9e9079d

Browse files
committed
Updated types file
- added constant exports and missing functions to Database
1 parent 946a3f6 commit 9e9079d

File tree

1 file changed

+100
-5
lines changed

1 file changed

+100
-5
lines changed

lib/sqlite3.d.ts

+100-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
// Type definitions for sqlite3 3.1
2-
// Project: http://github.com/mapbox/node-sqlite3
3-
// Definitions by: Nick Malaguti <https://github.com/nmalaguti>
4-
// Sumant Manne <https://github.com/dpyro>
5-
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
1+
// Type definitions for sqlite3
2+
// Project: http://github.com/tryghost/node-sqlite3
63

74
/// <reference types="node" />
85

@@ -11,10 +8,56 @@ import events = require("events");
118
export const OPEN_READONLY: number;
129
export const OPEN_READWRITE: number;
1310
export const OPEN_CREATE: number;
11+
export const OPEN_FULLMUTEX: number;
1412
export const OPEN_SHAREDCACHE: number;
1513
export const OPEN_PRIVATECACHE: number;
1614
export const OPEN_URI: number;
1715

16+
export const VERSION: string;
17+
export const SOURCE_ID: string;
18+
export const VERSION_NUMBER: number;
19+
20+
export const OK: number;
21+
export const ERROR: number;
22+
export const INTERNAL: number;
23+
export const PERM: number;
24+
export const ABORT: number;
25+
export const BUSY: number;
26+
export const LOCKED: number;
27+
export const NOMEM: number;
28+
export const READONLY: number;
29+
export const INTERRUPT: number
30+
export const IOERR: number;
31+
export const CORRUPT: number
32+
export const NOTFOUND: number;
33+
export const FULL: number;
34+
export const CANTOPEN: number;
35+
export const PROTOCOL: number;
36+
export const EMPTY: number;
37+
export const SCHEMA: number;
38+
export const TOOBIG: number
39+
export const CONSTRAINT: number
40+
export const MISMATCH: number;
41+
export const MISUSE: number;
42+
export const NOLFS: number;
43+
export const AUTH: number
44+
export const FORMAT: number;
45+
export const RANGE: number
46+
export const NOTADB: number;
47+
48+
export const LIMIT_LENGTH: number;
49+
export const LIMIT_SQL_LENGTH: number;
50+
export const LIMIT_COLUMN: number;
51+
export const LIMIT_EXPR_DEPTH: number;
52+
export const LIMIT_COMPOUND_SELECT: number;
53+
export const LIMIT_VDBE_OP: number;
54+
export const LIMIT_FUNCTION_ARG: number;
55+
export const LIMIT_ATTACHED: number;
56+
export const LIMIT_LIKE_PATTERN_LENGTH: number;
57+
export const LIMIT_VARIABLE_NUMBER: number;
58+
export const LIMIT_TRIGGER_DEPTH: number;
59+
export const LIMIT_WORKER_THREADS: number;
60+
1861
export const cached: {
1962
Database(filename: string, callback?: (this: Database, err: Error | null) => void): Database;
2063
Database(filename: string, mode?: number, callback?: (this: Database, err: Error | null) => void): Database;
@@ -83,13 +126,18 @@ export class Database extends events.EventEmitter {
83126

84127
on(event: "trace", listener: (sql: string) => void): this;
85128
on(event: "profile", listener: (sql: string, time: number) => void): this;
129+
on(event: "change", listener: (type: string, database: string, table: string, rowid: number) => void): this;
86130
on(event: "error", listener: (err: Error) => void): this;
87131
on(event: "open" | "close", listener: () => void): this;
88132
on(event: string, listener: (...args: any[]) => void): this;
89133

90134
configure(option: "busyTimeout", value: number): void;
91135
configure(option: "limit", id: number, value: number): void;
92136

137+
loadExtension(filename: string, callback?: (err: Error | null) => void): this;
138+
139+
wait(callback?: (param: null) => void): this;
140+
93141
interrupt(): void;
94142
}
95143

@@ -99,9 +147,56 @@ export interface sqlite3 {
99147
OPEN_READONLY: number;
100148
OPEN_READWRITE: number;
101149
OPEN_CREATE: number;
150+
OPEN_FULLMUTEX: number;
102151
OPEN_SHAREDCACHE: number;
103152
OPEN_PRIVATECACHE: number;
104153
OPEN_URI: number;
154+
155+
VERSION: string;
156+
SOURCE_ID: string;
157+
VERSION_NUMBER: number;
158+
159+
OK: number;
160+
ERROR: number;
161+
INTERNAL: number;
162+
PERM: number;
163+
ABORT: number;
164+
BUSY: number;
165+
LOCKED: number;
166+
NOMEM: number;
167+
READONLY: number;
168+
INTERRUPT: number
169+
IOERR: number;
170+
CORRUPT: number
171+
NOTFOUND: number;
172+
FULL: number;
173+
CANTOPEN: number;
174+
PROTOCOL: number;
175+
EMPTY: number;
176+
SCHEMA: number;
177+
TOOBIG: number
178+
CONSTRAINT: number
179+
MISMATCH: number;
180+
MISUSE: number;
181+
NOLFS: number;
182+
AUTH: number
183+
FORMAT: number;
184+
RANGE: number
185+
NOTADB: number;
186+
187+
LIMIT_LENGTH: number;
188+
LIMIT_SQL_LENGTH: number;
189+
LIMIT_COLUMN: number;
190+
LIMIT_EXPR_DEPTH: number;
191+
LIMIT_COMPOUND_SELECT: number;
192+
LIMIT_VDBE_OP: number;
193+
LIMIT_FUNCTION_ARG: number;
194+
LIMIT_ATTACHED: number;
195+
LIMIT_LIKE_PATTERN_LENGTH: number;
196+
LIMIT_VARIABLE_NUMBER: number;
197+
LIMIT_TRIGGER_DEPTH: number;
198+
LIMIT_WORKER_THREADS: number;
199+
105200
cached: typeof cached;
106201
RunResult: RunResult;
107202
Statement: typeof Statement;

0 commit comments

Comments
 (0)