@gjsify/sqlite-native 0.64.49-next.348 → 0.64.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/driver.js +0 -0
- package/lib/types/driver.d.ts +67 -0
- package/lib/types/index.d.ts +1 -0
- package/package.json +16 -13
|
File without changes
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/** What `column_blob()` returns: GLib.Bytes on GJS, a plain holder elsewhere. */
|
|
2
|
+
export interface SqliteBytes {
|
|
3
|
+
get_data(): Uint8Array | null;
|
|
4
|
+
}
|
|
5
|
+
export interface SqliteStatement {
|
|
6
|
+
readonly is_valid: boolean;
|
|
7
|
+
readonly column_count: number;
|
|
8
|
+
readonly bind_parameter_count: number;
|
|
9
|
+
readonly sql: string | null;
|
|
10
|
+
readonly expanded_sql: string | null;
|
|
11
|
+
close(): void;
|
|
12
|
+
reset(): void;
|
|
13
|
+
clear_bindings(): void;
|
|
14
|
+
/** SQLITE_ROW or SQLITE_DONE as `StepResult`; anything else throws. */
|
|
15
|
+
step(): number;
|
|
16
|
+
/** Parameter indices are 1-based, column indices 0-based, as in the C API. */
|
|
17
|
+
bind_null(index: number): void;
|
|
18
|
+
bind_double(index: number, value: number): void;
|
|
19
|
+
bind_int64(index: number, value: bigint | number): void;
|
|
20
|
+
bind_text(index: number, value: string): void;
|
|
21
|
+
bind_blob(index: number, value: SqliteBytes | Uint8Array): void;
|
|
22
|
+
/** 0 when the statement has no such name. */
|
|
23
|
+
bind_parameter_index(name: string): number;
|
|
24
|
+
/** The full name (`:a`, `@a`, `$a`, `?NNN`), or null for an anonymous `?`. */
|
|
25
|
+
bind_parameter_name(index: number): string | null;
|
|
26
|
+
column_name(index: number): string | null;
|
|
27
|
+
column_decltype(index: number): string | null;
|
|
28
|
+
/** A `ColumnType` of the CURRENT row. */
|
|
29
|
+
column_type(index: number): number;
|
|
30
|
+
column_double(index: number): number;
|
|
31
|
+
column_text(index: number): string | null;
|
|
32
|
+
column_blob(index: number): SqliteBytes;
|
|
33
|
+
}
|
|
34
|
+
export interface SqliteDatabase {
|
|
35
|
+
readonly is_open: boolean;
|
|
36
|
+
/** Of the most recent write on this connection. */
|
|
37
|
+
readonly last_insert_rowid: number;
|
|
38
|
+
readonly changes: number;
|
|
39
|
+
/** `sqlite3_get_autocommit() == 0`. */
|
|
40
|
+
readonly in_transaction: boolean;
|
|
41
|
+
/** One or more statements, `sqlite3_exec()` semantics. */
|
|
42
|
+
exec(sql: string): void;
|
|
43
|
+
prepare(sql: string): SqliteStatement;
|
|
44
|
+
/** Finalises every statement still live on this connection. */
|
|
45
|
+
close(): void;
|
|
46
|
+
}
|
|
47
|
+
export interface SqliteDriverModule {
|
|
48
|
+
Database: {
|
|
49
|
+
open(path: string, mode: number, uri: boolean): SqliteDatabase;
|
|
50
|
+
};
|
|
51
|
+
OpenMode: {
|
|
52
|
+
readonly READONLY: number;
|
|
53
|
+
readonly READWRITE: number;
|
|
54
|
+
readonly READWRITE_CREATE: number;
|
|
55
|
+
};
|
|
56
|
+
StepResult: {
|
|
57
|
+
readonly ROW: number;
|
|
58
|
+
readonly DONE: number;
|
|
59
|
+
};
|
|
60
|
+
ColumnType: {
|
|
61
|
+
readonly INTEGER: number;
|
|
62
|
+
readonly FLOAT: number;
|
|
63
|
+
readonly TEXT: number;
|
|
64
|
+
readonly BLOB: number;
|
|
65
|
+
readonly NULL: number;
|
|
66
|
+
};
|
|
67
|
+
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { GjsifySqlite as GjsifySqliteNS } from 'gi://GjsifySqlite?version=1.0';
|
|
2
|
+
export type { SqliteBytes, SqliteDatabase, SqliteDriverModule, SqliteStatement } from './driver.ts';
|
|
2
3
|
type DatabaseInstance = GjsifySqliteNS.Database;
|
|
3
4
|
type DatabaseStatic = typeof GjsifySqliteNS.Database;
|
|
4
5
|
type StatementInstance = GjsifySqliteNS.Statement;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/sqlite-native",
|
|
3
|
-
"version": "0.64.49
|
|
3
|
+
"version": "0.64.49",
|
|
4
4
|
"description": "Optional Vala/GObject bridge over the system libsqlite3, exposing the parts of the C API that cannot be expressed in JavaScript: a connection handle, prepared statements with 1-based parameter binding, and a typed column cursor. Errors carry sqlite's extended result code. Used by @gjsify/sqlite to implement node:sqlite directly on sqlite3 instead of through libgda.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/esm/index.js",
|
|
@@ -10,6 +10,10 @@
|
|
|
10
10
|
".": {
|
|
11
11
|
"types": "./lib/types/index.d.ts",
|
|
12
12
|
"default": "./lib/esm/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./driver": {
|
|
15
|
+
"types": "./lib/types/driver.d.ts",
|
|
16
|
+
"default": "./lib/esm/driver.js"
|
|
13
17
|
}
|
|
14
18
|
},
|
|
15
19
|
"files": [
|
|
@@ -64,11 +68,11 @@
|
|
|
64
68
|
"@girs/gjs": "5.4.0",
|
|
65
69
|
"@girs/glib-2.0": "5.4.0",
|
|
66
70
|
"@girs/gobject-2.0": "5.4.0",
|
|
67
|
-
"@gjsify/utils": "0.64.49
|
|
71
|
+
"@gjsify/utils": "0.64.49"
|
|
68
72
|
},
|
|
69
73
|
"devDependencies": {
|
|
70
|
-
"@gjsify/cli": "0.64.49
|
|
71
|
-
"@gjsify/unit": "0.64.49
|
|
74
|
+
"@gjsify/cli": "0.64.49",
|
|
75
|
+
"@gjsify/unit": "0.64.49",
|
|
72
76
|
"@ts-for-gir/cli": "^4.1.0",
|
|
73
77
|
"@types/node": "^25.9.2",
|
|
74
78
|
"typescript": "^6.0.3"
|
|
@@ -84,13 +88,12 @@
|
|
|
84
88
|
},
|
|
85
89
|
"homepage": "https://github.com/gjsify/gjsify/tree/main/packages/node/sqlite-native#readme",
|
|
86
90
|
"optionalDependencies": {
|
|
87
|
-
"@gjsify/sqlite-native-darwin-arm64": "0.64.49
|
|
88
|
-
"@gjsify/sqlite-native-darwin-x64": "0.64.49
|
|
89
|
-
"@gjsify/sqlite-native-linux-arm64": "0.64.49
|
|
90
|
-
"@gjsify/sqlite-native-linux-ppc64": "0.64.49
|
|
91
|
-
"@gjsify/sqlite-native-linux-riscv64": "0.64.49
|
|
92
|
-
"@gjsify/sqlite-native-linux-s390x": "0.64.49
|
|
93
|
-
"@gjsify/sqlite-native-linux-x64": "0.64.49
|
|
94
|
-
}
|
|
95
|
-
"gitHead": "c61ed1ad2d0c4bacbd6a1652663d5bfbf2fca47b"
|
|
91
|
+
"@gjsify/sqlite-native-darwin-arm64": "0.64.49",
|
|
92
|
+
"@gjsify/sqlite-native-darwin-x64": "0.64.49",
|
|
93
|
+
"@gjsify/sqlite-native-linux-arm64": "0.64.49",
|
|
94
|
+
"@gjsify/sqlite-native-linux-ppc64": "0.64.49",
|
|
95
|
+
"@gjsify/sqlite-native-linux-riscv64": "0.64.49",
|
|
96
|
+
"@gjsify/sqlite-native-linux-s390x": "0.64.49",
|
|
97
|
+
"@gjsify/sqlite-native-linux-x64": "0.64.49"
|
|
98
|
+
}
|
|
96
99
|
}
|