@elaraai/east-node-io 0.0.1-beta.8 → 1.0.0
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/CLA.md +1 -1
- package/CONTRIBUTING.md +3 -3
- package/LICENSE.md +31 -0
- package/README.md +56 -19
- package/dist/{compression → src/compression}/gzip.d.ts +1 -1
- package/dist/src/compression/gzip.d.ts.map +1 -0
- package/dist/{compression → src/compression}/gzip.js +3 -3
- package/dist/src/compression/gzip.js.map +1 -0
- package/dist/{compression → src/compression}/index.d.ts +16 -16
- package/dist/src/compression/index.d.ts.map +1 -0
- package/dist/src/compression/index.js.map +1 -0
- package/dist/{compression → src/compression}/tar.d.ts +2 -2
- package/dist/src/compression/tar.d.ts.map +1 -0
- package/dist/{compression → src/compression}/tar.js +7 -7
- package/dist/src/compression/tar.js.map +1 -0
- package/dist/{compression → src/compression}/types.d.ts +10 -10
- package/dist/src/compression/types.d.ts.map +1 -0
- package/dist/src/compression/types.js.map +1 -0
- package/dist/{compression → src/compression}/zip.d.ts +3 -3
- package/dist/src/compression/zip.d.ts.map +1 -0
- package/dist/{compression → src/compression}/zip.js +4 -4
- package/dist/src/compression/zip.js.map +1 -0
- package/dist/src/connection/index.d.ts.map +1 -0
- package/dist/{connection → src/connection}/index.js +2 -2
- package/dist/src/connection/index.js.map +1 -0
- package/dist/{format → src/format}/index.d.ts +77 -77
- package/dist/src/format/index.d.ts.map +1 -0
- package/dist/src/format/index.js.map +1 -0
- package/dist/{format → src/format}/types.d.ts +53 -53
- package/dist/src/format/types.d.ts.map +1 -0
- package/dist/src/format/types.js.map +1 -0
- package/dist/{format → src/format}/xlsx.d.ts +20 -20
- package/dist/src/format/xlsx.d.ts.map +1 -0
- package/dist/{format → src/format}/xlsx.js +6 -6
- package/dist/src/format/xlsx.js.map +1 -0
- package/dist/{format → src/format}/xml.d.ts +54 -54
- package/dist/src/format/xml.d.ts.map +1 -0
- package/dist/{format → src/format}/xml.js +14 -14
- package/dist/src/format/xml.js.map +1 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js.map +1 -0
- package/dist/{nosql → src/nosql}/index.d.ts +20 -20
- package/dist/src/nosql/index.d.ts.map +1 -0
- package/dist/src/nosql/index.js.map +1 -0
- package/dist/{nosql → src/nosql}/mongodb.d.ts +5 -5
- package/dist/src/nosql/mongodb.d.ts.map +1 -0
- package/dist/{nosql → src/nosql}/mongodb.js +8 -8
- package/dist/src/nosql/mongodb.js.map +1 -0
- package/dist/{nosql → src/nosql}/redis.d.ts +5 -5
- package/dist/src/nosql/redis.d.ts.map +1 -0
- package/dist/{nosql → src/nosql}/redis.js +6 -6
- package/dist/src/nosql/redis.js.map +1 -0
- package/dist/{nosql → src/nosql}/types.d.ts +10 -10
- package/dist/src/nosql/types.d.ts.map +1 -0
- package/dist/src/nosql/types.js.map +1 -0
- package/dist/src/platform.d.ts.map +1 -0
- package/dist/{platform.js → src/platform.js} +2 -0
- package/dist/src/platform.js.map +1 -0
- package/dist/src/sql/access.d.ts +243 -0
- package/dist/src/sql/access.d.ts.map +1 -0
- package/dist/src/sql/access.js +427 -0
- package/dist/src/sql/access.js.map +1 -0
- package/dist/src/sql/index.d.ts +1112 -0
- package/dist/src/sql/index.d.ts.map +1 -0
- package/dist/{sql → src/sql}/index.js +296 -4
- package/dist/src/sql/index.js.map +1 -0
- package/dist/{sql → src/sql}/mysql.d.ts +110 -32
- package/dist/src/sql/mysql.d.ts.map +1 -0
- package/dist/{sql → src/sql}/mysql.js +207 -6
- package/dist/src/sql/mysql.js.map +1 -0
- package/dist/{sql → src/sql}/postgres.d.ts +110 -32
- package/dist/src/sql/postgres.d.ts.map +1 -0
- package/dist/{sql → src/sql}/postgres.js +199 -6
- package/dist/src/sql/postgres.js.map +1 -0
- package/dist/{sql → src/sql}/sqlite.d.ts +108 -30
- package/dist/src/sql/sqlite.d.ts.map +1 -0
- package/dist/{sql → src/sql}/sqlite.js +209 -6
- package/dist/src/sql/sqlite.js.map +1 -0
- package/dist/src/sql/types.d.ts +269 -0
- package/dist/src/sql/types.d.ts.map +1 -0
- package/dist/{sql → src/sql}/types.js +65 -1
- package/dist/src/sql/types.js.map +1 -0
- package/dist/{storage → src/storage}/index.d.ts +63 -63
- package/dist/src/storage/index.d.ts.map +1 -0
- package/dist/{storage → src/storage}/index.js +1 -1
- package/dist/src/storage/index.js.map +1 -0
- package/dist/{storage → src/storage}/s3.d.ts +56 -49
- package/dist/src/storage/s3.d.ts.map +1 -0
- package/dist/{storage → src/storage}/s3.js +24 -15
- package/dist/src/storage/s3.js.map +1 -0
- package/dist/{storage → src/storage}/types.d.ts +18 -18
- package/dist/src/storage/types.d.ts.map +1 -0
- package/dist/src/storage/types.js.map +1 -0
- package/dist/{transfer → src/transfer}/ftp.d.ts +10 -10
- package/dist/src/transfer/ftp.d.ts.map +1 -0
- package/dist/{transfer → src/transfer}/ftp.js +6 -6
- package/dist/src/transfer/ftp.js.map +1 -0
- package/dist/{transfer → src/transfer}/index.d.ts +40 -40
- package/dist/src/transfer/index.d.ts.map +1 -0
- package/dist/src/transfer/index.js.map +1 -0
- package/dist/{transfer → src/transfer}/sftp.d.ts +10 -10
- package/dist/src/transfer/sftp.d.ts.map +1 -0
- package/dist/{transfer → src/transfer}/sftp.js +6 -6
- package/dist/src/transfer/sftp.js.map +1 -0
- package/dist/{transfer → src/transfer}/types.d.ts +15 -15
- package/dist/src/transfer/types.d.ts.map +1 -0
- package/dist/src/transfer/types.js.map +1 -0
- package/package.json +37 -53
- package/dist/compression/gzip.d.ts.map +0 -1
- package/dist/compression/gzip.js.map +0 -1
- package/dist/compression/index.d.ts.map +0 -1
- package/dist/compression/index.js.map +0 -1
- package/dist/compression/tar.d.ts.map +0 -1
- package/dist/compression/tar.js.map +0 -1
- package/dist/compression/types.d.ts.map +0 -1
- package/dist/compression/types.js.map +0 -1
- package/dist/compression/zip.d.ts.map +0 -1
- package/dist/compression/zip.js.map +0 -1
- package/dist/connection/index.d.ts.map +0 -1
- package/dist/connection/index.js.map +0 -1
- package/dist/format/index.d.ts.map +0 -1
- package/dist/format/index.js.map +0 -1
- package/dist/format/types.d.ts.map +0 -1
- package/dist/format/types.js.map +0 -1
- package/dist/format/xlsx.d.ts.map +0 -1
- package/dist/format/xlsx.js.map +0 -1
- package/dist/format/xml.d.ts.map +0 -1
- package/dist/format/xml.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/nosql/index.d.ts.map +0 -1
- package/dist/nosql/index.js.map +0 -1
- package/dist/nosql/mongodb.d.ts.map +0 -1
- package/dist/nosql/mongodb.js.map +0 -1
- package/dist/nosql/redis.d.ts.map +0 -1
- package/dist/nosql/redis.js.map +0 -1
- package/dist/nosql/types.d.ts.map +0 -1
- package/dist/nosql/types.js.map +0 -1
- package/dist/platform.d.ts.map +0 -1
- package/dist/platform.js.map +0 -1
- package/dist/sql/index.d.ts +0 -777
- package/dist/sql/index.d.ts.map +0 -1
- package/dist/sql/index.js.map +0 -1
- package/dist/sql/mysql.d.ts.map +0 -1
- package/dist/sql/mysql.js.map +0 -1
- package/dist/sql/postgres.d.ts.map +0 -1
- package/dist/sql/postgres.js.map +0 -1
- package/dist/sql/sqlite.d.ts.map +0 -1
- package/dist/sql/sqlite.js.map +0 -1
- package/dist/sql/types.d.ts +0 -205
- package/dist/sql/types.d.ts.map +0 -1
- package/dist/sql/types.js.map +0 -1
- package/dist/storage/index.d.ts.map +0 -1
- package/dist/storage/index.js.map +0 -1
- package/dist/storage/s3.d.ts.map +0 -1
- package/dist/storage/s3.js.map +0 -1
- package/dist/storage/types.d.ts.map +0 -1
- package/dist/storage/types.js.map +0 -1
- package/dist/transfer/ftp.d.ts.map +0 -1
- package/dist/transfer/ftp.js.map +0 -1
- package/dist/transfer/index.d.ts.map +0 -1
- package/dist/transfer/index.js.map +0 -1
- package/dist/transfer/sftp.d.ts.map +0 -1
- package/dist/transfer/sftp.js.map +0 -1
- package/dist/transfer/types.d.ts.map +0 -1
- package/dist/transfer/types.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- /package/dist/{compression → src/compression}/index.js +0 -0
- /package/dist/{compression → src/compression}/types.js +0 -0
- /package/dist/{connection → src/connection}/index.d.ts +0 -0
- /package/dist/{format → src/format}/index.js +0 -0
- /package/dist/{format → src/format}/types.js +0 -0
- /package/dist/{index.d.ts → src/index.d.ts} +0 -0
- /package/dist/{index.js → src/index.js} +0 -0
- /package/dist/{nosql → src/nosql}/index.js +0 -0
- /package/dist/{nosql → src/nosql}/types.js +0 -0
- /package/dist/{platform.d.ts → src/platform.d.ts} +0 -0
- /package/dist/{storage → src/storage}/types.js +0 -0
- /package/dist/{transfer → src/transfer}/index.js +0 -0
- /package/dist/{transfer → src/transfer}/types.js +0 -0
|
@@ -0,0 +1,1112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* SQL database platform functions.
|
|
7
|
+
*
|
|
8
|
+
* Provides type-safe SQL database operations for East programs, supporting
|
|
9
|
+
* SQLite, PostgreSQL, and MySQL with connection pooling and parameterized queries.
|
|
10
|
+
*
|
|
11
|
+
* @packageDocumentation
|
|
12
|
+
*/
|
|
13
|
+
export * from "./sqlite.js";
|
|
14
|
+
export * from "./postgres.js";
|
|
15
|
+
export * from "./mysql.js";
|
|
16
|
+
export * from "./access.js";
|
|
17
|
+
export * from "./types.js";
|
|
18
|
+
/**
|
|
19
|
+
* SQL database platform functions.
|
|
20
|
+
*
|
|
21
|
+
* Provides type-safe SQL database operations for East programs, supporting
|
|
22
|
+
* SQLite, PostgreSQL, and MySQL with connection pooling and parameterized queries.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* import { East, StringType, IntegerType, NullType, variant } from "@elaraai/east";
|
|
27
|
+
* import { SQL } from "@elaraai/east-node-io";
|
|
28
|
+
*
|
|
29
|
+
* const getUserName = East.function([IntegerType], NullType, ($, userId) => {
|
|
30
|
+
* const config = $.let({
|
|
31
|
+
* host: "localhost",
|
|
32
|
+
* port: 5432n,
|
|
33
|
+
* database: "myapp",
|
|
34
|
+
* user: "postgres",
|
|
35
|
+
* password: "secret",
|
|
36
|
+
* ssl: variant('none', null),
|
|
37
|
+
* maxConnections: variant('none', null),
|
|
38
|
+
* });
|
|
39
|
+
*
|
|
40
|
+
* const conn = $.let(SQL.Postgres.connect(config));
|
|
41
|
+
* $(SQL.Postgres.query(
|
|
42
|
+
* conn,
|
|
43
|
+
* "SELECT name FROM users WHERE id = $1",
|
|
44
|
+
* [variant('Integer', userId)]
|
|
45
|
+
* ));
|
|
46
|
+
* $(SQL.Postgres.close(conn));
|
|
47
|
+
* $.return(null);
|
|
48
|
+
* });
|
|
49
|
+
*
|
|
50
|
+
* // All SQL operations are async
|
|
51
|
+
* const compiled = East.compileAsync(getUserName.toIR(), SQL.Postgres.Implementation);
|
|
52
|
+
* await compiled(42n);
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare const SQL: {
|
|
56
|
+
/**
|
|
57
|
+
* SQLite database operations.
|
|
58
|
+
*
|
|
59
|
+
* Provides platform functions for SQLite, a serverless embedded SQL database.
|
|
60
|
+
*/
|
|
61
|
+
readonly SQLite: {
|
|
62
|
+
/**
|
|
63
|
+
* Opens a SQLite database connection.
|
|
64
|
+
*
|
|
65
|
+
* Creates a connection to a SQLite database file or in-memory database
|
|
66
|
+
* and returns an opaque handle for use in queries.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```ts
|
|
70
|
+
* const getUser = East.function([IntegerType], NullType, ($, userId) => {
|
|
71
|
+
* const config = $.let({
|
|
72
|
+
* path: "./mydb.sqlite",
|
|
73
|
+
* readOnly: variant('none', null),
|
|
74
|
+
* memory: variant('none', null),
|
|
75
|
+
* });
|
|
76
|
+
*
|
|
77
|
+
* const conn = $.let(SQL.SQLite.connect(config));
|
|
78
|
+
* $(SQL.SQLite.query(
|
|
79
|
+
* conn,
|
|
80
|
+
* "SELECT name FROM users WHERE id = ?",
|
|
81
|
+
* [variant('Integer', userId)]
|
|
82
|
+
* ));
|
|
83
|
+
* $(SQL.SQLite.close(conn));
|
|
84
|
+
* $.return(null);
|
|
85
|
+
* });
|
|
86
|
+
*
|
|
87
|
+
* const compiled = East.compileAsync(getUser.toIR(), SQL.SQLite.Implementation);
|
|
88
|
+
* await compiled(42n);
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
readonly connect: import("@elaraai/east").AsyncPlatformDefinition<[import("@elaraai/east").StructType<{
|
|
92
|
+
readonly path: import("./types.js").StringType;
|
|
93
|
+
readonly readOnly: import("@elaraai/east").OptionType<import("@elaraai/east").BooleanType>;
|
|
94
|
+
readonly memory: import("@elaraai/east").OptionType<import("@elaraai/east").BooleanType>;
|
|
95
|
+
}>], import("./types.js").StringType>;
|
|
96
|
+
/**
|
|
97
|
+
* Executes a SQL query with parameters.
|
|
98
|
+
*
|
|
99
|
+
* Runs a SQL query with parameter binding using ? placeholders.
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```ts
|
|
103
|
+
* const getUser = East.function([IntegerType], NullType, ($, userId) => {
|
|
104
|
+
* const config = $.let({
|
|
105
|
+
* path: "./mydb.sqlite",
|
|
106
|
+
* readOnly: variant('none', null),
|
|
107
|
+
* memory: variant('none', null),
|
|
108
|
+
* });
|
|
109
|
+
* const conn = $.let(SQL.SQLite.connect(config));
|
|
110
|
+
* $(SQL.SQLite.query(
|
|
111
|
+
* conn,
|
|
112
|
+
* "SELECT name FROM users WHERE id = ?",
|
|
113
|
+
* [variant('Integer', userId)]
|
|
114
|
+
* ));
|
|
115
|
+
* $(SQL.SQLite.close(conn));
|
|
116
|
+
* $.return(null);
|
|
117
|
+
* });
|
|
118
|
+
*
|
|
119
|
+
* const compiled = East.compileAsync(getUser.toIR(), SQL.SQLite.Implementation);
|
|
120
|
+
* await compiled(42n);
|
|
121
|
+
* ```
|
|
122
|
+
*/
|
|
123
|
+
readonly query: import("@elaraai/east").AsyncPlatformDefinition<[import("./types.js").StringType, import("./types.js").StringType, import("@elaraai/east").ArrayType<import("@elaraai/east").VariantType<{
|
|
124
|
+
readonly Null: import("@elaraai/east").NullType;
|
|
125
|
+
readonly Boolean: import("@elaraai/east").BooleanType;
|
|
126
|
+
readonly Integer: import("@elaraai/east").IntegerType;
|
|
127
|
+
readonly Float: import("@elaraai/east").FloatType;
|
|
128
|
+
readonly String: import("./types.js").StringType;
|
|
129
|
+
readonly DateTime: import("@elaraai/east").DateTimeType;
|
|
130
|
+
readonly Blob: import("@elaraai/east").BlobType;
|
|
131
|
+
}>>], import("@elaraai/east").VariantType<{
|
|
132
|
+
readonly select: import("@elaraai/east").StructType<{
|
|
133
|
+
readonly rows: import("@elaraai/east").ArrayType<import("@elaraai/east").DictType<import("./types.js").StringType, import("@elaraai/east").VariantType<{
|
|
134
|
+
readonly Null: import("@elaraai/east").NullType;
|
|
135
|
+
readonly Boolean: import("@elaraai/east").BooleanType;
|
|
136
|
+
readonly Integer: import("@elaraai/east").IntegerType;
|
|
137
|
+
readonly Float: import("@elaraai/east").FloatType;
|
|
138
|
+
readonly String: import("./types.js").StringType;
|
|
139
|
+
readonly DateTime: import("@elaraai/east").DateTimeType;
|
|
140
|
+
readonly Blob: import("@elaraai/east").BlobType;
|
|
141
|
+
}>>>;
|
|
142
|
+
}>;
|
|
143
|
+
readonly insert: import("@elaraai/east").StructType<{
|
|
144
|
+
readonly rowsAffected: import("@elaraai/east").IntegerType;
|
|
145
|
+
readonly lastInsertId: import("@elaraai/east").OptionType<import("@elaraai/east").IntegerType>;
|
|
146
|
+
}>;
|
|
147
|
+
readonly update: import("@elaraai/east").StructType<{
|
|
148
|
+
readonly rowsAffected: import("@elaraai/east").IntegerType;
|
|
149
|
+
}>;
|
|
150
|
+
readonly delete: import("@elaraai/east").StructType<{
|
|
151
|
+
readonly rowsAffected: import("@elaraai/east").IntegerType;
|
|
152
|
+
}>;
|
|
153
|
+
}>>;
|
|
154
|
+
/**
|
|
155
|
+
* Executes a SELECT query with user-defined return type.
|
|
156
|
+
*
|
|
157
|
+
* Runs a SELECT query and returns typed rows. The return type is generic,
|
|
158
|
+
* allowing users to specify the expected row structure for type-safe access.
|
|
159
|
+
*
|
|
160
|
+
* @example
|
|
161
|
+
* ```ts
|
|
162
|
+
* const UserRowType = StructType({
|
|
163
|
+
* id: IntegerType,
|
|
164
|
+
* name: StringType,
|
|
165
|
+
* });
|
|
166
|
+
*
|
|
167
|
+
* const getUsers = East.function([], NullType, ($) => {
|
|
168
|
+
* const config = $.let({
|
|
169
|
+
* path: ":memory:",
|
|
170
|
+
* readOnly: variant('none', null),
|
|
171
|
+
* memory: variant('some', true),
|
|
172
|
+
* });
|
|
173
|
+
* const conn = $.let(SQL.SQLite.connect(config));
|
|
174
|
+
*
|
|
175
|
+
* // Create table and insert data
|
|
176
|
+
* $(SQL.SQLite.query(conn, "CREATE TABLE users (id INTEGER, name TEXT)", []));
|
|
177
|
+
* $(SQL.SQLite.query(conn, "INSERT INTO users VALUES (1, 'Alice')", []));
|
|
178
|
+
*
|
|
179
|
+
* // Query with typed results
|
|
180
|
+
* const users = $.let(SQL.SQLite.select([UserRowType], conn,
|
|
181
|
+
* "SELECT id, name FROM users",
|
|
182
|
+
* []
|
|
183
|
+
* ));
|
|
184
|
+
* // users is typed as Array<{ id: bigint, name: string }>
|
|
185
|
+
*
|
|
186
|
+
* $(SQL.SQLite.close(conn));
|
|
187
|
+
* $.return(null);
|
|
188
|
+
* });
|
|
189
|
+
*
|
|
190
|
+
* const compiled = East.compileAsync(getUsers.toIR(), SQL.SQLite.Implementation);
|
|
191
|
+
* await compiled();
|
|
192
|
+
* ```
|
|
193
|
+
*/
|
|
194
|
+
readonly select: import("@elaraai/east").AsyncGenericPlatformDefinition<readonly ["T"], readonly [import("./types.js").StringType, import("./types.js").StringType, import("@elaraai/east").ArrayType<import("@elaraai/east").VariantType<{
|
|
195
|
+
readonly Null: import("@elaraai/east").NullType;
|
|
196
|
+
readonly Boolean: import("@elaraai/east").BooleanType;
|
|
197
|
+
readonly Integer: import("@elaraai/east").IntegerType;
|
|
198
|
+
readonly Float: import("@elaraai/east").FloatType;
|
|
199
|
+
readonly String: import("./types.js").StringType;
|
|
200
|
+
readonly DateTime: import("@elaraai/east").DateTimeType;
|
|
201
|
+
readonly Blob: import("@elaraai/east").BlobType;
|
|
202
|
+
}>>], import("@elaraai/east").ArrayType<"T">>;
|
|
203
|
+
/**
|
|
204
|
+
* Closes the SQLite database connection.
|
|
205
|
+
*
|
|
206
|
+
* Releases all resources associated with the connection.
|
|
207
|
+
*
|
|
208
|
+
* @example
|
|
209
|
+
* ```ts
|
|
210
|
+
* const cleanup = East.function([], NullType, $ => {
|
|
211
|
+
* const config = $.let({
|
|
212
|
+
* path: "./mydb.sqlite",
|
|
213
|
+
* readOnly: variant('none', null),
|
|
214
|
+
* memory: variant('none', null),
|
|
215
|
+
* });
|
|
216
|
+
* const conn = $.let(SQL.SQLite.connect(config));
|
|
217
|
+
* // ... do work ...
|
|
218
|
+
* $(SQL.SQLite.close(conn));
|
|
219
|
+
* $.return(null);
|
|
220
|
+
* });
|
|
221
|
+
*
|
|
222
|
+
* const compiled = East.compileAsync(cleanup.toIR(), SQL.SQLite.Implementation);
|
|
223
|
+
* await compiled();
|
|
224
|
+
* ```
|
|
225
|
+
*/
|
|
226
|
+
readonly close: import("@elaraai/east").AsyncPlatformDefinition<[import("./types.js").StringType], import("@elaraai/east").NullType>;
|
|
227
|
+
/**
|
|
228
|
+
* Closes all SQLite connections.
|
|
229
|
+
*
|
|
230
|
+
* Closes all active SQLite connections and releases all resources.
|
|
231
|
+
* Useful for test cleanup to ensure all connections are closed.
|
|
232
|
+
*
|
|
233
|
+
* @returns Null on success
|
|
234
|
+
*
|
|
235
|
+
* @example
|
|
236
|
+
* ```ts
|
|
237
|
+
* const cleanupAll = East.function([], NullType, $ => {
|
|
238
|
+
* // ... test code that may have left connections open ...
|
|
239
|
+
* $(SQL.SQLite.closeAll());
|
|
240
|
+
* return $.return(null);
|
|
241
|
+
* });
|
|
242
|
+
*
|
|
243
|
+
* const compiled = East.compileAsync(cleanupAll.toIR(), SQL.SQLite.Implementation);
|
|
244
|
+
* await compiled();
|
|
245
|
+
* ```
|
|
246
|
+
*
|
|
247
|
+
* @internal
|
|
248
|
+
*/
|
|
249
|
+
readonly closeAll: import("@elaraai/east").AsyncPlatformDefinition<[], import("@elaraai/east").NullType>;
|
|
250
|
+
/**
|
|
251
|
+
* Node.js implementation of SQLite platform functions.
|
|
252
|
+
*
|
|
253
|
+
* Pass this to East.compileAsync() to enable SQLite operations.
|
|
254
|
+
*/
|
|
255
|
+
readonly Implementation: import("@elaraai/east/internal").PlatformFunction[];
|
|
256
|
+
/**
|
|
257
|
+
* Type definitions for SQLite operations.
|
|
258
|
+
*/
|
|
259
|
+
readonly Types: {
|
|
260
|
+
/**
|
|
261
|
+
* SQLite connection configuration type.
|
|
262
|
+
*/
|
|
263
|
+
readonly Config: import("@elaraai/east").StructType<{
|
|
264
|
+
readonly path: import("./types.js").StringType;
|
|
265
|
+
readonly readOnly: import("@elaraai/east").OptionType<import("@elaraai/east").BooleanType>;
|
|
266
|
+
readonly memory: import("@elaraai/east").OptionType<import("@elaraai/east").BooleanType>;
|
|
267
|
+
}>;
|
|
268
|
+
/**
|
|
269
|
+
* SQL query parameter value type.
|
|
270
|
+
*/
|
|
271
|
+
readonly Parameter: import("@elaraai/east").VariantType<{
|
|
272
|
+
readonly Null: import("@elaraai/east").NullType;
|
|
273
|
+
readonly Boolean: import("@elaraai/east").BooleanType;
|
|
274
|
+
readonly Integer: import("@elaraai/east").IntegerType;
|
|
275
|
+
readonly Float: import("@elaraai/east").FloatType;
|
|
276
|
+
readonly String: import("./types.js").StringType;
|
|
277
|
+
readonly DateTime: import("@elaraai/east").DateTimeType;
|
|
278
|
+
readonly Blob: import("@elaraai/east").BlobType;
|
|
279
|
+
}>;
|
|
280
|
+
/**
|
|
281
|
+
* Array of SQL query parameters.
|
|
282
|
+
*/
|
|
283
|
+
readonly Parameters: import("@elaraai/east").ArrayType<import("@elaraai/east").VariantType<{
|
|
284
|
+
readonly Null: import("@elaraai/east").NullType;
|
|
285
|
+
readonly Boolean: import("@elaraai/east").BooleanType;
|
|
286
|
+
readonly Integer: import("@elaraai/east").IntegerType;
|
|
287
|
+
readonly Float: import("@elaraai/east").FloatType;
|
|
288
|
+
readonly String: import("./types.js").StringType;
|
|
289
|
+
readonly DateTime: import("@elaraai/east").DateTimeType;
|
|
290
|
+
readonly Blob: import("@elaraai/east").BlobType;
|
|
291
|
+
}>>;
|
|
292
|
+
/**
|
|
293
|
+
* SQL query result row type.
|
|
294
|
+
*/
|
|
295
|
+
readonly Row: import("@elaraai/east").DictType<import("./types.js").StringType, import("@elaraai/east").VariantType<{
|
|
296
|
+
readonly Null: import("@elaraai/east").NullType;
|
|
297
|
+
readonly Boolean: import("@elaraai/east").BooleanType;
|
|
298
|
+
readonly Integer: import("@elaraai/east").IntegerType;
|
|
299
|
+
readonly Float: import("@elaraai/east").FloatType;
|
|
300
|
+
readonly String: import("./types.js").StringType;
|
|
301
|
+
readonly DateTime: import("@elaraai/east").DateTimeType;
|
|
302
|
+
readonly Blob: import("@elaraai/east").BlobType;
|
|
303
|
+
}>>;
|
|
304
|
+
/**
|
|
305
|
+
* SQL query execution result type.
|
|
306
|
+
*/
|
|
307
|
+
readonly Result: import("@elaraai/east").VariantType<{
|
|
308
|
+
readonly select: import("@elaraai/east").StructType<{
|
|
309
|
+
readonly rows: import("@elaraai/east").ArrayType<import("@elaraai/east").DictType<import("./types.js").StringType, import("@elaraai/east").VariantType<{
|
|
310
|
+
readonly Null: import("@elaraai/east").NullType;
|
|
311
|
+
readonly Boolean: import("@elaraai/east").BooleanType;
|
|
312
|
+
readonly Integer: import("@elaraai/east").IntegerType;
|
|
313
|
+
readonly Float: import("@elaraai/east").FloatType;
|
|
314
|
+
readonly String: import("./types.js").StringType;
|
|
315
|
+
readonly DateTime: import("@elaraai/east").DateTimeType;
|
|
316
|
+
readonly Blob: import("@elaraai/east").BlobType;
|
|
317
|
+
}>>>;
|
|
318
|
+
}>;
|
|
319
|
+
readonly insert: import("@elaraai/east").StructType<{
|
|
320
|
+
readonly rowsAffected: import("@elaraai/east").IntegerType;
|
|
321
|
+
readonly lastInsertId: import("@elaraai/east").OptionType<import("@elaraai/east").IntegerType>;
|
|
322
|
+
}>;
|
|
323
|
+
readonly update: import("@elaraai/east").StructType<{
|
|
324
|
+
readonly rowsAffected: import("@elaraai/east").IntegerType;
|
|
325
|
+
}>;
|
|
326
|
+
readonly delete: import("@elaraai/east").StructType<{
|
|
327
|
+
readonly rowsAffected: import("@elaraai/east").IntegerType;
|
|
328
|
+
}>;
|
|
329
|
+
}>;
|
|
330
|
+
};
|
|
331
|
+
};
|
|
332
|
+
/**
|
|
333
|
+
* PostgreSQL database operations.
|
|
334
|
+
*
|
|
335
|
+
* Provides platform functions for PostgreSQL with connection pooling.
|
|
336
|
+
*/
|
|
337
|
+
readonly Postgres: {
|
|
338
|
+
/**
|
|
339
|
+
* Connects to a PostgreSQL database.
|
|
340
|
+
*
|
|
341
|
+
* Creates a connection pool to a PostgreSQL database and returns an
|
|
342
|
+
* opaque handle for use in queries.
|
|
343
|
+
*
|
|
344
|
+
* @example
|
|
345
|
+
* ```ts
|
|
346
|
+
* const getUser = East.function([IntegerType], NullType, ($, userId) => {
|
|
347
|
+
* const config = $.let({
|
|
348
|
+
* host: "localhost",
|
|
349
|
+
* port: 5432n,
|
|
350
|
+
* database: "myapp",
|
|
351
|
+
* user: "postgres",
|
|
352
|
+
* password: "secret",
|
|
353
|
+
* ssl: variant('none', null),
|
|
354
|
+
* maxConnections: variant('none', null),
|
|
355
|
+
* });
|
|
356
|
+
*
|
|
357
|
+
* const conn = $.let(SQL.Postgres.connect(config));
|
|
358
|
+
* $(SQL.Postgres.query(
|
|
359
|
+
* conn,
|
|
360
|
+
* "SELECT name FROM users WHERE id = $1",
|
|
361
|
+
* [variant('Integer', userId)]
|
|
362
|
+
* ));
|
|
363
|
+
* $(SQL.Postgres.close(conn));
|
|
364
|
+
* $.return(null);
|
|
365
|
+
* });
|
|
366
|
+
*
|
|
367
|
+
* const compiled = East.compileAsync(getUser.toIR(), SQL.Postgres.Implementation);
|
|
368
|
+
* await compiled(42n);
|
|
369
|
+
* ```
|
|
370
|
+
*/
|
|
371
|
+
readonly connect: import("@elaraai/east").AsyncPlatformDefinition<[import("@elaraai/east").StructType<{
|
|
372
|
+
readonly host: import("./types.js").StringType;
|
|
373
|
+
readonly port: import("@elaraai/east").IntegerType;
|
|
374
|
+
readonly database: import("./types.js").StringType;
|
|
375
|
+
readonly user: import("./types.js").StringType;
|
|
376
|
+
readonly password: import("./types.js").StringType;
|
|
377
|
+
readonly ssl: import("@elaraai/east").OptionType<import("@elaraai/east").BooleanType>;
|
|
378
|
+
readonly maxConnections: import("@elaraai/east").OptionType<import("@elaraai/east").IntegerType>;
|
|
379
|
+
}>], import("./types.js").StringType>;
|
|
380
|
+
/**
|
|
381
|
+
* Executes a SQL query with parameters.
|
|
382
|
+
*
|
|
383
|
+
* Runs a SQL query with parameter binding using $1, $2, etc. placeholders.
|
|
384
|
+
*
|
|
385
|
+
* @example
|
|
386
|
+
* ```ts
|
|
387
|
+
* const getUser = East.function([IntegerType], NullType, ($, userId) => {
|
|
388
|
+
* const config = $.let({
|
|
389
|
+
* host: "localhost",
|
|
390
|
+
* port: 5432n,
|
|
391
|
+
* database: "myapp",
|
|
392
|
+
* user: "postgres",
|
|
393
|
+
* password: "secret",
|
|
394
|
+
* ssl: variant('none', null),
|
|
395
|
+
* maxConnections: variant('none', null),
|
|
396
|
+
* });
|
|
397
|
+
* const conn = $.let(SQL.Postgres.connect(config));
|
|
398
|
+
* $(SQL.Postgres.query(
|
|
399
|
+
* conn,
|
|
400
|
+
* "SELECT name FROM users WHERE id = $1",
|
|
401
|
+
* [variant('Integer', userId)]
|
|
402
|
+
* ));
|
|
403
|
+
* $(SQL.Postgres.close(conn));
|
|
404
|
+
* $.return(null);
|
|
405
|
+
* });
|
|
406
|
+
*
|
|
407
|
+
* const compiled = East.compileAsync(getUser.toIR(), SQL.Postgres.Implementation);
|
|
408
|
+
* await compiled(42n);
|
|
409
|
+
* ```
|
|
410
|
+
*/
|
|
411
|
+
readonly query: import("@elaraai/east").AsyncPlatformDefinition<[import("./types.js").StringType, import("./types.js").StringType, import("@elaraai/east").ArrayType<import("@elaraai/east").VariantType<{
|
|
412
|
+
readonly Null: import("@elaraai/east").NullType;
|
|
413
|
+
readonly Boolean: import("@elaraai/east").BooleanType;
|
|
414
|
+
readonly Integer: import("@elaraai/east").IntegerType;
|
|
415
|
+
readonly Float: import("@elaraai/east").FloatType;
|
|
416
|
+
readonly String: import("./types.js").StringType;
|
|
417
|
+
readonly DateTime: import("@elaraai/east").DateTimeType;
|
|
418
|
+
readonly Blob: import("@elaraai/east").BlobType;
|
|
419
|
+
}>>], import("@elaraai/east").VariantType<{
|
|
420
|
+
readonly select: import("@elaraai/east").StructType<{
|
|
421
|
+
readonly rows: import("@elaraai/east").ArrayType<import("@elaraai/east").DictType<import("./types.js").StringType, import("@elaraai/east").VariantType<{
|
|
422
|
+
readonly Null: import("@elaraai/east").NullType;
|
|
423
|
+
readonly Boolean: import("@elaraai/east").BooleanType;
|
|
424
|
+
readonly Integer: import("@elaraai/east").IntegerType;
|
|
425
|
+
readonly Float: import("@elaraai/east").FloatType;
|
|
426
|
+
readonly String: import("./types.js").StringType;
|
|
427
|
+
readonly DateTime: import("@elaraai/east").DateTimeType;
|
|
428
|
+
readonly Blob: import("@elaraai/east").BlobType;
|
|
429
|
+
}>>>;
|
|
430
|
+
}>;
|
|
431
|
+
readonly insert: import("@elaraai/east").StructType<{
|
|
432
|
+
readonly rowsAffected: import("@elaraai/east").IntegerType;
|
|
433
|
+
readonly lastInsertId: import("@elaraai/east").OptionType<import("@elaraai/east").IntegerType>;
|
|
434
|
+
}>;
|
|
435
|
+
readonly update: import("@elaraai/east").StructType<{
|
|
436
|
+
readonly rowsAffected: import("@elaraai/east").IntegerType;
|
|
437
|
+
}>;
|
|
438
|
+
readonly delete: import("@elaraai/east").StructType<{
|
|
439
|
+
readonly rowsAffected: import("@elaraai/east").IntegerType;
|
|
440
|
+
}>;
|
|
441
|
+
}>>;
|
|
442
|
+
/**
|
|
443
|
+
* Executes a SELECT query with user-defined return type.
|
|
444
|
+
*
|
|
445
|
+
* Runs a SELECT query and returns typed rows. The return type is generic,
|
|
446
|
+
* allowing users to specify the expected row structure for type-safe access.
|
|
447
|
+
*
|
|
448
|
+
* @example
|
|
449
|
+
* ```ts
|
|
450
|
+
* const UserRowType = StructType({
|
|
451
|
+
* id: IntegerType,
|
|
452
|
+
* name: StringType,
|
|
453
|
+
* });
|
|
454
|
+
*
|
|
455
|
+
* const getUsers = East.function([], NullType, ($) => {
|
|
456
|
+
* const config = $.let({
|
|
457
|
+
* host: "localhost",
|
|
458
|
+
* port: 5432n,
|
|
459
|
+
* database: "myapp",
|
|
460
|
+
* user: "postgres",
|
|
461
|
+
* password: "secret",
|
|
462
|
+
* ssl: variant('none', null),
|
|
463
|
+
* maxConnections: variant('none', null),
|
|
464
|
+
* });
|
|
465
|
+
* const conn = $.let(SQL.Postgres.connect(config));
|
|
466
|
+
*
|
|
467
|
+
* // Query with typed results
|
|
468
|
+
* const users = $.let(SQL.Postgres.select([UserRowType], conn,
|
|
469
|
+
* "SELECT id, name FROM users",
|
|
470
|
+
* []
|
|
471
|
+
* ));
|
|
472
|
+
* // users is typed as Array<{ id: bigint, name: string }>
|
|
473
|
+
*
|
|
474
|
+
* $(SQL.Postgres.close(conn));
|
|
475
|
+
* $.return(null);
|
|
476
|
+
* });
|
|
477
|
+
*
|
|
478
|
+
* const compiled = East.compileAsync(getUsers.toIR(), SQL.Postgres.Implementation);
|
|
479
|
+
* await compiled();
|
|
480
|
+
* ```
|
|
481
|
+
*/
|
|
482
|
+
readonly select: import("@elaraai/east").AsyncGenericPlatformDefinition<readonly ["T"], readonly [import("./types.js").StringType, import("./types.js").StringType, import("@elaraai/east").ArrayType<import("@elaraai/east").VariantType<{
|
|
483
|
+
readonly Null: import("@elaraai/east").NullType;
|
|
484
|
+
readonly Boolean: import("@elaraai/east").BooleanType;
|
|
485
|
+
readonly Integer: import("@elaraai/east").IntegerType;
|
|
486
|
+
readonly Float: import("@elaraai/east").FloatType;
|
|
487
|
+
readonly String: import("./types.js").StringType;
|
|
488
|
+
readonly DateTime: import("@elaraai/east").DateTimeType;
|
|
489
|
+
readonly Blob: import("@elaraai/east").BlobType;
|
|
490
|
+
}>>], import("@elaraai/east").ArrayType<"T">>;
|
|
491
|
+
/**
|
|
492
|
+
* Closes the PostgreSQL connection pool.
|
|
493
|
+
*
|
|
494
|
+
* Terminates all connections and releases all resources.
|
|
495
|
+
*
|
|
496
|
+
* @example
|
|
497
|
+
* ```ts
|
|
498
|
+
* const cleanup = East.function([], NullType, $ => {
|
|
499
|
+
* const config = $.let({
|
|
500
|
+
* host: "localhost",
|
|
501
|
+
* port: 5432n,
|
|
502
|
+
* database: "myapp",
|
|
503
|
+
* user: "postgres",
|
|
504
|
+
* password: "secret",
|
|
505
|
+
* ssl: variant('none', null),
|
|
506
|
+
* maxConnections: variant('none', null),
|
|
507
|
+
* });
|
|
508
|
+
* const conn = $.let(SQL.Postgres.connect(config));
|
|
509
|
+
* // ... do work ...
|
|
510
|
+
* $(SQL.Postgres.close(conn));
|
|
511
|
+
* $.return(null);
|
|
512
|
+
* });
|
|
513
|
+
*
|
|
514
|
+
* const compiled = East.compileAsync(cleanup.toIR(), SQL.Postgres.Implementation);
|
|
515
|
+
* await compiled();
|
|
516
|
+
* ```
|
|
517
|
+
*/
|
|
518
|
+
readonly close: import("@elaraai/east").AsyncPlatformDefinition<[import("./types.js").StringType], import("@elaraai/east").NullType>;
|
|
519
|
+
/**
|
|
520
|
+
* Closes all PostgreSQL connections.
|
|
521
|
+
*
|
|
522
|
+
* Closes all active PostgreSQL connection pools and releases all resources.
|
|
523
|
+
* Useful for test cleanup to ensure all connections are closed.
|
|
524
|
+
*
|
|
525
|
+
* @returns Null on success
|
|
526
|
+
*
|
|
527
|
+
* @example
|
|
528
|
+
* ```ts
|
|
529
|
+
* const cleanupAll = East.function([], NullType, $ => {
|
|
530
|
+
* // ... test code that may have left connections open ...
|
|
531
|
+
* $(SQL.Postgres.closeAll());
|
|
532
|
+
* return $.return(null);
|
|
533
|
+
* });
|
|
534
|
+
*
|
|
535
|
+
* const compiled = East.compileAsync(cleanupAll.toIR(), SQL.Postgres.Implementation);
|
|
536
|
+
* await compiled();
|
|
537
|
+
* ```
|
|
538
|
+
*
|
|
539
|
+
* @internal
|
|
540
|
+
*/
|
|
541
|
+
readonly closeAll: import("@elaraai/east").AsyncPlatformDefinition<[], import("@elaraai/east").NullType>;
|
|
542
|
+
/**
|
|
543
|
+
* Node.js implementation of PostgreSQL platform functions.
|
|
544
|
+
*
|
|
545
|
+
* Pass this to East.compileAsync() to enable PostgreSQL operations.
|
|
546
|
+
*/
|
|
547
|
+
readonly Implementation: import("@elaraai/east/internal").PlatformFunction[];
|
|
548
|
+
/**
|
|
549
|
+
* Type definitions for PostgreSQL operations.
|
|
550
|
+
*/
|
|
551
|
+
readonly Types: {
|
|
552
|
+
/**
|
|
553
|
+
* PostgreSQL connection configuration type.
|
|
554
|
+
*/
|
|
555
|
+
readonly Config: import("@elaraai/east").StructType<{
|
|
556
|
+
readonly host: import("./types.js").StringType;
|
|
557
|
+
readonly port: import("@elaraai/east").IntegerType;
|
|
558
|
+
readonly database: import("./types.js").StringType;
|
|
559
|
+
readonly user: import("./types.js").StringType;
|
|
560
|
+
readonly password: import("./types.js").StringType;
|
|
561
|
+
readonly ssl: import("@elaraai/east").OptionType<import("@elaraai/east").BooleanType>;
|
|
562
|
+
readonly maxConnections: import("@elaraai/east").OptionType<import("@elaraai/east").IntegerType>;
|
|
563
|
+
}>;
|
|
564
|
+
/**
|
|
565
|
+
* SQL query parameter value type.
|
|
566
|
+
*/
|
|
567
|
+
readonly Parameter: import("@elaraai/east").VariantType<{
|
|
568
|
+
readonly Null: import("@elaraai/east").NullType;
|
|
569
|
+
readonly Boolean: import("@elaraai/east").BooleanType;
|
|
570
|
+
readonly Integer: import("@elaraai/east").IntegerType;
|
|
571
|
+
readonly Float: import("@elaraai/east").FloatType;
|
|
572
|
+
readonly String: import("./types.js").StringType;
|
|
573
|
+
readonly DateTime: import("@elaraai/east").DateTimeType;
|
|
574
|
+
readonly Blob: import("@elaraai/east").BlobType;
|
|
575
|
+
}>;
|
|
576
|
+
/**
|
|
577
|
+
* Array of SQL query parameters.
|
|
578
|
+
*/
|
|
579
|
+
readonly Parameters: import("@elaraai/east").ArrayType<import("@elaraai/east").VariantType<{
|
|
580
|
+
readonly Null: import("@elaraai/east").NullType;
|
|
581
|
+
readonly Boolean: import("@elaraai/east").BooleanType;
|
|
582
|
+
readonly Integer: import("@elaraai/east").IntegerType;
|
|
583
|
+
readonly Float: import("@elaraai/east").FloatType;
|
|
584
|
+
readonly String: import("./types.js").StringType;
|
|
585
|
+
readonly DateTime: import("@elaraai/east").DateTimeType;
|
|
586
|
+
readonly Blob: import("@elaraai/east").BlobType;
|
|
587
|
+
}>>;
|
|
588
|
+
/**
|
|
589
|
+
* SQL query result row type.
|
|
590
|
+
*/
|
|
591
|
+
readonly Row: import("@elaraai/east").DictType<import("./types.js").StringType, import("@elaraai/east").VariantType<{
|
|
592
|
+
readonly Null: import("@elaraai/east").NullType;
|
|
593
|
+
readonly Boolean: import("@elaraai/east").BooleanType;
|
|
594
|
+
readonly Integer: import("@elaraai/east").IntegerType;
|
|
595
|
+
readonly Float: import("@elaraai/east").FloatType;
|
|
596
|
+
readonly String: import("./types.js").StringType;
|
|
597
|
+
readonly DateTime: import("@elaraai/east").DateTimeType;
|
|
598
|
+
readonly Blob: import("@elaraai/east").BlobType;
|
|
599
|
+
}>>;
|
|
600
|
+
/**
|
|
601
|
+
* SQL query execution result type.
|
|
602
|
+
*/
|
|
603
|
+
readonly Result: import("@elaraai/east").VariantType<{
|
|
604
|
+
readonly select: import("@elaraai/east").StructType<{
|
|
605
|
+
readonly rows: import("@elaraai/east").ArrayType<import("@elaraai/east").DictType<import("./types.js").StringType, import("@elaraai/east").VariantType<{
|
|
606
|
+
readonly Null: import("@elaraai/east").NullType;
|
|
607
|
+
readonly Boolean: import("@elaraai/east").BooleanType;
|
|
608
|
+
readonly Integer: import("@elaraai/east").IntegerType;
|
|
609
|
+
readonly Float: import("@elaraai/east").FloatType;
|
|
610
|
+
readonly String: import("./types.js").StringType;
|
|
611
|
+
readonly DateTime: import("@elaraai/east").DateTimeType;
|
|
612
|
+
readonly Blob: import("@elaraai/east").BlobType;
|
|
613
|
+
}>>>;
|
|
614
|
+
}>;
|
|
615
|
+
readonly insert: import("@elaraai/east").StructType<{
|
|
616
|
+
readonly rowsAffected: import("@elaraai/east").IntegerType;
|
|
617
|
+
readonly lastInsertId: import("@elaraai/east").OptionType<import("@elaraai/east").IntegerType>;
|
|
618
|
+
}>;
|
|
619
|
+
readonly update: import("@elaraai/east").StructType<{
|
|
620
|
+
readonly rowsAffected: import("@elaraai/east").IntegerType;
|
|
621
|
+
}>;
|
|
622
|
+
readonly delete: import("@elaraai/east").StructType<{
|
|
623
|
+
readonly rowsAffected: import("@elaraai/east").IntegerType;
|
|
624
|
+
}>;
|
|
625
|
+
}>;
|
|
626
|
+
};
|
|
627
|
+
};
|
|
628
|
+
/**
|
|
629
|
+
* MySQL database operations.
|
|
630
|
+
*
|
|
631
|
+
* Provides platform functions for MySQL with connection pooling.
|
|
632
|
+
*/
|
|
633
|
+
readonly MySQL: {
|
|
634
|
+
/**
|
|
635
|
+
* Connects to a MySQL database.
|
|
636
|
+
*
|
|
637
|
+
* Creates a connection pool to a MySQL database and returns an
|
|
638
|
+
* opaque handle for use in queries.
|
|
639
|
+
*
|
|
640
|
+
* @example
|
|
641
|
+
* ```ts
|
|
642
|
+
* const getUser = East.function([IntegerType], NullType, ($, userId) => {
|
|
643
|
+
* const config = $.let({
|
|
644
|
+
* host: "localhost",
|
|
645
|
+
* port: 3306n,
|
|
646
|
+
* database: "myapp",
|
|
647
|
+
* user: "root",
|
|
648
|
+
* password: "secret",
|
|
649
|
+
* ssl: variant('none', null),
|
|
650
|
+
* maxConnections: variant('none', null),
|
|
651
|
+
* });
|
|
652
|
+
*
|
|
653
|
+
* const conn = $.let(SQL.MySQL.connect(config));
|
|
654
|
+
* $(SQL.MySQL.query(
|
|
655
|
+
* conn,
|
|
656
|
+
* "SELECT name FROM users WHERE id = ?",
|
|
657
|
+
* [variant('Integer', userId)]
|
|
658
|
+
* ));
|
|
659
|
+
* $(SQL.MySQL.close(conn));
|
|
660
|
+
* $.return(null);
|
|
661
|
+
* });
|
|
662
|
+
*
|
|
663
|
+
* const compiled = East.compileAsync(getUser.toIR(), SQL.MySQL.Implementation);
|
|
664
|
+
* await compiled(42n);
|
|
665
|
+
* ```
|
|
666
|
+
*/
|
|
667
|
+
readonly connect: import("@elaraai/east").AsyncPlatformDefinition<[import("@elaraai/east").StructType<{
|
|
668
|
+
readonly host: import("./types.js").StringType;
|
|
669
|
+
readonly port: import("@elaraai/east").IntegerType;
|
|
670
|
+
readonly database: import("./types.js").StringType;
|
|
671
|
+
readonly user: import("./types.js").StringType;
|
|
672
|
+
readonly password: import("./types.js").StringType;
|
|
673
|
+
readonly ssl: import("@elaraai/east").OptionType<import("@elaraai/east").BooleanType>;
|
|
674
|
+
readonly maxConnections: import("@elaraai/east").OptionType<import("@elaraai/east").IntegerType>;
|
|
675
|
+
}>], import("./types.js").StringType>;
|
|
676
|
+
/**
|
|
677
|
+
* Executes a SQL query with parameters.
|
|
678
|
+
*
|
|
679
|
+
* Runs a SQL query with parameter binding using ? placeholders.
|
|
680
|
+
*
|
|
681
|
+
* @example
|
|
682
|
+
* ```ts
|
|
683
|
+
* const getUser = East.function([IntegerType], NullType, ($, userId) => {
|
|
684
|
+
* const config = $.let({
|
|
685
|
+
* host: "localhost",
|
|
686
|
+
* port: 3306n,
|
|
687
|
+
* database: "myapp",
|
|
688
|
+
* user: "root",
|
|
689
|
+
* password: "secret",
|
|
690
|
+
* ssl: variant('none', null),
|
|
691
|
+
* maxConnections: variant('none', null),
|
|
692
|
+
* });
|
|
693
|
+
* const conn = $.let(SQL.MySQL.connect(config));
|
|
694
|
+
* $(SQL.MySQL.query(
|
|
695
|
+
* conn,
|
|
696
|
+
* "SELECT name FROM users WHERE id = ?",
|
|
697
|
+
* [variant('Integer', userId)]
|
|
698
|
+
* ));
|
|
699
|
+
* $(SQL.MySQL.close(conn));
|
|
700
|
+
* $.return(null);
|
|
701
|
+
* });
|
|
702
|
+
*
|
|
703
|
+
* const compiled = East.compileAsync(getUser.toIR(), SQL.MySQL.Implementation);
|
|
704
|
+
* await compiled(42n);
|
|
705
|
+
* ```
|
|
706
|
+
*/
|
|
707
|
+
readonly query: import("@elaraai/east").AsyncPlatformDefinition<[import("./types.js").StringType, import("./types.js").StringType, import("@elaraai/east").ArrayType<import("@elaraai/east").VariantType<{
|
|
708
|
+
readonly Null: import("@elaraai/east").NullType;
|
|
709
|
+
readonly Boolean: import("@elaraai/east").BooleanType;
|
|
710
|
+
readonly Integer: import("@elaraai/east").IntegerType;
|
|
711
|
+
readonly Float: import("@elaraai/east").FloatType;
|
|
712
|
+
readonly String: import("./types.js").StringType;
|
|
713
|
+
readonly DateTime: import("@elaraai/east").DateTimeType;
|
|
714
|
+
readonly Blob: import("@elaraai/east").BlobType;
|
|
715
|
+
}>>], import("@elaraai/east").VariantType<{
|
|
716
|
+
readonly select: import("@elaraai/east").StructType<{
|
|
717
|
+
readonly rows: import("@elaraai/east").ArrayType<import("@elaraai/east").DictType<import("./types.js").StringType, import("@elaraai/east").VariantType<{
|
|
718
|
+
readonly Null: import("@elaraai/east").NullType;
|
|
719
|
+
readonly Boolean: import("@elaraai/east").BooleanType;
|
|
720
|
+
readonly Integer: import("@elaraai/east").IntegerType;
|
|
721
|
+
readonly Float: import("@elaraai/east").FloatType;
|
|
722
|
+
readonly String: import("./types.js").StringType;
|
|
723
|
+
readonly DateTime: import("@elaraai/east").DateTimeType;
|
|
724
|
+
readonly Blob: import("@elaraai/east").BlobType;
|
|
725
|
+
}>>>;
|
|
726
|
+
}>;
|
|
727
|
+
readonly insert: import("@elaraai/east").StructType<{
|
|
728
|
+
readonly rowsAffected: import("@elaraai/east").IntegerType;
|
|
729
|
+
readonly lastInsertId: import("@elaraai/east").OptionType<import("@elaraai/east").IntegerType>;
|
|
730
|
+
}>;
|
|
731
|
+
readonly update: import("@elaraai/east").StructType<{
|
|
732
|
+
readonly rowsAffected: import("@elaraai/east").IntegerType;
|
|
733
|
+
}>;
|
|
734
|
+
readonly delete: import("@elaraai/east").StructType<{
|
|
735
|
+
readonly rowsAffected: import("@elaraai/east").IntegerType;
|
|
736
|
+
}>;
|
|
737
|
+
}>>;
|
|
738
|
+
/**
|
|
739
|
+
* Executes a SELECT query with user-defined return type.
|
|
740
|
+
*
|
|
741
|
+
* Runs a SELECT query and returns typed rows. The return type is generic,
|
|
742
|
+
* allowing users to specify the expected row structure for type-safe access.
|
|
743
|
+
*
|
|
744
|
+
* @example
|
|
745
|
+
* ```ts
|
|
746
|
+
* const UserRowType = StructType({
|
|
747
|
+
* id: IntegerType,
|
|
748
|
+
* name: StringType,
|
|
749
|
+
* });
|
|
750
|
+
*
|
|
751
|
+
* const getUsers = East.function([], NullType, ($) => {
|
|
752
|
+
* const config = $.let({
|
|
753
|
+
* host: "localhost",
|
|
754
|
+
* port: 3306n,
|
|
755
|
+
* database: "myapp",
|
|
756
|
+
* user: "root",
|
|
757
|
+
* password: "secret",
|
|
758
|
+
* ssl: variant('none', null),
|
|
759
|
+
* maxConnections: variant('none', null),
|
|
760
|
+
* });
|
|
761
|
+
* const conn = $.let(SQL.MySQL.connect(config));
|
|
762
|
+
*
|
|
763
|
+
* // Query with typed results
|
|
764
|
+
* const users = $.let(SQL.MySQL.select([UserRowType], conn,
|
|
765
|
+
* "SELECT id, name FROM users",
|
|
766
|
+
* []
|
|
767
|
+
* ));
|
|
768
|
+
* // users is typed as Array<{ id: bigint, name: string }>
|
|
769
|
+
*
|
|
770
|
+
* $(SQL.MySQL.close(conn));
|
|
771
|
+
* $.return(null);
|
|
772
|
+
* });
|
|
773
|
+
*
|
|
774
|
+
* const compiled = East.compileAsync(getUsers.toIR(), SQL.MySQL.Implementation);
|
|
775
|
+
* await compiled();
|
|
776
|
+
* ```
|
|
777
|
+
*/
|
|
778
|
+
readonly select: import("@elaraai/east").AsyncGenericPlatformDefinition<readonly ["T"], readonly [import("./types.js").StringType, import("./types.js").StringType, import("@elaraai/east").ArrayType<import("@elaraai/east").VariantType<{
|
|
779
|
+
readonly Null: import("@elaraai/east").NullType;
|
|
780
|
+
readonly Boolean: import("@elaraai/east").BooleanType;
|
|
781
|
+
readonly Integer: import("@elaraai/east").IntegerType;
|
|
782
|
+
readonly Float: import("@elaraai/east").FloatType;
|
|
783
|
+
readonly String: import("./types.js").StringType;
|
|
784
|
+
readonly DateTime: import("@elaraai/east").DateTimeType;
|
|
785
|
+
readonly Blob: import("@elaraai/east").BlobType;
|
|
786
|
+
}>>], import("@elaraai/east").ArrayType<"T">>;
|
|
787
|
+
/**
|
|
788
|
+
* Closes the MySQL connection pool.
|
|
789
|
+
*
|
|
790
|
+
* Terminates all connections and releases all resources.
|
|
791
|
+
*
|
|
792
|
+
* @example
|
|
793
|
+
* ```ts
|
|
794
|
+
* const cleanup = East.function([], NullType, $ => {
|
|
795
|
+
* const config = $.let({
|
|
796
|
+
* host: "localhost",
|
|
797
|
+
* port: 3306n,
|
|
798
|
+
* database: "myapp",
|
|
799
|
+
* user: "root",
|
|
800
|
+
* password: "secret",
|
|
801
|
+
* ssl: variant('none', null),
|
|
802
|
+
* maxConnections: variant('none', null),
|
|
803
|
+
* });
|
|
804
|
+
* const conn = $.let(SQL.MySQL.connect(config));
|
|
805
|
+
* // ... do work ...
|
|
806
|
+
* $(SQL.MySQL.close(conn));
|
|
807
|
+
* $.return(null);
|
|
808
|
+
* });
|
|
809
|
+
*
|
|
810
|
+
* const compiled = East.compileAsync(cleanup.toIR(), SQL.MySQL.Implementation);
|
|
811
|
+
* await compiled();
|
|
812
|
+
* ```
|
|
813
|
+
*/
|
|
814
|
+
readonly close: import("@elaraai/east").AsyncPlatformDefinition<[import("./types.js").StringType], import("@elaraai/east").NullType>;
|
|
815
|
+
/**
|
|
816
|
+
* Closes all MySQL connections.
|
|
817
|
+
*
|
|
818
|
+
* Closes all active MySQL connection pools and releases all resources.
|
|
819
|
+
* Useful for test cleanup to ensure all connections are closed.
|
|
820
|
+
*
|
|
821
|
+
* @returns Null on success
|
|
822
|
+
*
|
|
823
|
+
* @example
|
|
824
|
+
* ```ts
|
|
825
|
+
* const cleanupAll = East.function([], NullType, $ => {
|
|
826
|
+
* // ... test code that may have left connections open ...
|
|
827
|
+
* $(SQL.MySQL.closeAll());
|
|
828
|
+
* return $.return(null);
|
|
829
|
+
* });
|
|
830
|
+
*
|
|
831
|
+
* const compiled = East.compileAsync(cleanupAll.toIR(), SQL.MySQL.Implementation);
|
|
832
|
+
* await compiled();
|
|
833
|
+
* ```
|
|
834
|
+
*
|
|
835
|
+
* @internal
|
|
836
|
+
*/
|
|
837
|
+
readonly closeAll: import("@elaraai/east").AsyncPlatformDefinition<[], import("@elaraai/east").NullType>;
|
|
838
|
+
/**
|
|
839
|
+
* Node.js implementation of MySQL platform functions.
|
|
840
|
+
*
|
|
841
|
+
* Pass this to East.compileAsync() to enable MySQL operations.
|
|
842
|
+
*/
|
|
843
|
+
readonly Implementation: import("@elaraai/east/internal").PlatformFunction[];
|
|
844
|
+
/**
|
|
845
|
+
* Type definitions for MySQL operations.
|
|
846
|
+
*/
|
|
847
|
+
readonly Types: {
|
|
848
|
+
/**
|
|
849
|
+
* MySQL connection configuration type.
|
|
850
|
+
*/
|
|
851
|
+
readonly Config: import("@elaraai/east").StructType<{
|
|
852
|
+
readonly host: import("./types.js").StringType;
|
|
853
|
+
readonly port: import("@elaraai/east").IntegerType;
|
|
854
|
+
readonly database: import("./types.js").StringType;
|
|
855
|
+
readonly user: import("./types.js").StringType;
|
|
856
|
+
readonly password: import("./types.js").StringType;
|
|
857
|
+
readonly ssl: import("@elaraai/east").OptionType<import("@elaraai/east").BooleanType>;
|
|
858
|
+
readonly maxConnections: import("@elaraai/east").OptionType<import("@elaraai/east").IntegerType>;
|
|
859
|
+
}>;
|
|
860
|
+
/**
|
|
861
|
+
* SQL query parameter value type.
|
|
862
|
+
*/
|
|
863
|
+
readonly Parameter: import("@elaraai/east").VariantType<{
|
|
864
|
+
readonly Null: import("@elaraai/east").NullType;
|
|
865
|
+
readonly Boolean: import("@elaraai/east").BooleanType;
|
|
866
|
+
readonly Integer: import("@elaraai/east").IntegerType;
|
|
867
|
+
readonly Float: import("@elaraai/east").FloatType;
|
|
868
|
+
readonly String: import("./types.js").StringType;
|
|
869
|
+
readonly DateTime: import("@elaraai/east").DateTimeType;
|
|
870
|
+
readonly Blob: import("@elaraai/east").BlobType;
|
|
871
|
+
}>;
|
|
872
|
+
/**
|
|
873
|
+
* Array of SQL query parameters.
|
|
874
|
+
*/
|
|
875
|
+
readonly Parameters: import("@elaraai/east").ArrayType<import("@elaraai/east").VariantType<{
|
|
876
|
+
readonly Null: import("@elaraai/east").NullType;
|
|
877
|
+
readonly Boolean: import("@elaraai/east").BooleanType;
|
|
878
|
+
readonly Integer: import("@elaraai/east").IntegerType;
|
|
879
|
+
readonly Float: import("@elaraai/east").FloatType;
|
|
880
|
+
readonly String: import("./types.js").StringType;
|
|
881
|
+
readonly DateTime: import("@elaraai/east").DateTimeType;
|
|
882
|
+
readonly Blob: import("@elaraai/east").BlobType;
|
|
883
|
+
}>>;
|
|
884
|
+
/**
|
|
885
|
+
* SQL query result row type.
|
|
886
|
+
*/
|
|
887
|
+
readonly Row: import("@elaraai/east").DictType<import("./types.js").StringType, import("@elaraai/east").VariantType<{
|
|
888
|
+
readonly Null: import("@elaraai/east").NullType;
|
|
889
|
+
readonly Boolean: import("@elaraai/east").BooleanType;
|
|
890
|
+
readonly Integer: import("@elaraai/east").IntegerType;
|
|
891
|
+
readonly Float: import("@elaraai/east").FloatType;
|
|
892
|
+
readonly String: import("./types.js").StringType;
|
|
893
|
+
readonly DateTime: import("@elaraai/east").DateTimeType;
|
|
894
|
+
readonly Blob: import("@elaraai/east").BlobType;
|
|
895
|
+
}>>;
|
|
896
|
+
/**
|
|
897
|
+
* SQL query execution result type.
|
|
898
|
+
*/
|
|
899
|
+
readonly Result: import("@elaraai/east").VariantType<{
|
|
900
|
+
readonly select: import("@elaraai/east").StructType<{
|
|
901
|
+
readonly rows: import("@elaraai/east").ArrayType<import("@elaraai/east").DictType<import("./types.js").StringType, import("@elaraai/east").VariantType<{
|
|
902
|
+
readonly Null: import("@elaraai/east").NullType;
|
|
903
|
+
readonly Boolean: import("@elaraai/east").BooleanType;
|
|
904
|
+
readonly Integer: import("@elaraai/east").IntegerType;
|
|
905
|
+
readonly Float: import("@elaraai/east").FloatType;
|
|
906
|
+
readonly String: import("./types.js").StringType;
|
|
907
|
+
readonly DateTime: import("@elaraai/east").DateTimeType;
|
|
908
|
+
readonly Blob: import("@elaraai/east").BlobType;
|
|
909
|
+
}>>>;
|
|
910
|
+
}>;
|
|
911
|
+
readonly insert: import("@elaraai/east").StructType<{
|
|
912
|
+
readonly rowsAffected: import("@elaraai/east").IntegerType;
|
|
913
|
+
readonly lastInsertId: import("@elaraai/east").OptionType<import("@elaraai/east").IntegerType>;
|
|
914
|
+
}>;
|
|
915
|
+
readonly update: import("@elaraai/east").StructType<{
|
|
916
|
+
readonly rowsAffected: import("@elaraai/east").IntegerType;
|
|
917
|
+
}>;
|
|
918
|
+
readonly delete: import("@elaraai/east").StructType<{
|
|
919
|
+
readonly rowsAffected: import("@elaraai/east").IntegerType;
|
|
920
|
+
}>;
|
|
921
|
+
}>;
|
|
922
|
+
};
|
|
923
|
+
};
|
|
924
|
+
/**
|
|
925
|
+
* Microsoft Access database operations.
|
|
926
|
+
*
|
|
927
|
+
* Provides read-only platform functions for Access databases (.mdb, .accdb).
|
|
928
|
+
* Supports Access 97 through Access 2019, including encrypted databases.
|
|
929
|
+
*/
|
|
930
|
+
readonly Access: {
|
|
931
|
+
/**
|
|
932
|
+
* Opens a Microsoft Access database file.
|
|
933
|
+
*
|
|
934
|
+
* Opens an Access database file and returns an opaque handle for use in queries.
|
|
935
|
+
*
|
|
936
|
+
* @example
|
|
937
|
+
* ```ts
|
|
938
|
+
* const listTables = East.function([], NullType, ($) => {
|
|
939
|
+
* const config = $.let({
|
|
940
|
+
* path: "./database.mdb",
|
|
941
|
+
* password: variant('none', null),
|
|
942
|
+
* });
|
|
943
|
+
*
|
|
944
|
+
* const conn = $.let(SQL.Access.open(config));
|
|
945
|
+
* const tables = $.let(SQL.Access.tables(conn));
|
|
946
|
+
* $(SQL.Access.close(conn));
|
|
947
|
+
* $.return(null);
|
|
948
|
+
* });
|
|
949
|
+
*
|
|
950
|
+
* const compiled = East.compileAsync(listTables.toIR(), SQL.Access.Implementation);
|
|
951
|
+
* await compiled();
|
|
952
|
+
* ```
|
|
953
|
+
*/
|
|
954
|
+
readonly open: import("@elaraai/east").AsyncPlatformDefinition<[import("@elaraai/east").StructType<{
|
|
955
|
+
readonly path: import("./types.js").StringType;
|
|
956
|
+
readonly password: import("@elaraai/east").OptionType<import("./types.js").StringType>;
|
|
957
|
+
}>], import("./types.js").StringType>;
|
|
958
|
+
/**
|
|
959
|
+
* Lists all table names in an Access database.
|
|
960
|
+
*
|
|
961
|
+
* Returns an array of normal table names (not system or linked tables).
|
|
962
|
+
*
|
|
963
|
+
* @example
|
|
964
|
+
* ```ts
|
|
965
|
+
* const showTables = East.function([], NullType, ($) => {
|
|
966
|
+
* const config = $.let({
|
|
967
|
+
* path: "./database.mdb",
|
|
968
|
+
* password: variant('none', null),
|
|
969
|
+
* });
|
|
970
|
+
*
|
|
971
|
+
* const conn = $.let(SQL.Access.open(config));
|
|
972
|
+
* const result = $.let(SQL.Access.tables(conn));
|
|
973
|
+
* // result.tables contains ['Table1', 'Table2', ...]
|
|
974
|
+
* $(SQL.Access.close(conn));
|
|
975
|
+
* $.return(null);
|
|
976
|
+
* });
|
|
977
|
+
*
|
|
978
|
+
* const compiled = East.compileAsync(showTables.toIR(), SQL.Access.Implementation);
|
|
979
|
+
* await compiled();
|
|
980
|
+
* ```
|
|
981
|
+
*/
|
|
982
|
+
readonly tables: import("@elaraai/east").AsyncPlatformDefinition<[import("./types.js").StringType], import("@elaraai/east").StructType<{
|
|
983
|
+
readonly tables: import("@elaraai/east").ArrayType<import("./types.js").StringType>;
|
|
984
|
+
}>>;
|
|
985
|
+
/**
|
|
986
|
+
* Queries data from an Access database table with a user-defined return type.
|
|
987
|
+
*
|
|
988
|
+
* Reads rows from a specified table with optional column selection and pagination.
|
|
989
|
+
* The return type is generic, allowing users to specify the expected row structure.
|
|
990
|
+
*
|
|
991
|
+
* @typeParam T - The expected row type for query results
|
|
992
|
+
*
|
|
993
|
+
* @example
|
|
994
|
+
* ```ts
|
|
995
|
+
* // Define the expected row type
|
|
996
|
+
* const UserRowType = StructType({
|
|
997
|
+
* id: IntegerType,
|
|
998
|
+
* name: StringType,
|
|
999
|
+
* email: StringType,
|
|
1000
|
+
* });
|
|
1001
|
+
*
|
|
1002
|
+
* const queryUsers = East.function([], NullType, ($) => {
|
|
1003
|
+
* const config = $.let({
|
|
1004
|
+
* path: "./database.mdb",
|
|
1005
|
+
* password: variant('none', null),
|
|
1006
|
+
* });
|
|
1007
|
+
*
|
|
1008
|
+
* const conn = $.let(SQL.Access.open(config));
|
|
1009
|
+
* // Query with typed results - returns Array<UserRowType>
|
|
1010
|
+
* const users = $.let(SQL.Access.query([UserRowType], conn, {
|
|
1011
|
+
* table: "Users",
|
|
1012
|
+
* columns: variant('some', ["id", "name", "email"]),
|
|
1013
|
+
* rowOffset: variant('none', null),
|
|
1014
|
+
* rowLimit: variant('some', 100n),
|
|
1015
|
+
* }));
|
|
1016
|
+
* // users is typed as Array<{ id: bigint, name: string, email: string }>
|
|
1017
|
+
* $(SQL.Access.close(conn));
|
|
1018
|
+
* $.return(null);
|
|
1019
|
+
* });
|
|
1020
|
+
*
|
|
1021
|
+
* const compiled = East.compileAsync(queryUsers.toIR(), SQL.Access.Implementation);
|
|
1022
|
+
* await compiled();
|
|
1023
|
+
* ```
|
|
1024
|
+
*/
|
|
1025
|
+
readonly query: import("@elaraai/east").AsyncGenericPlatformDefinition<readonly ["T"], readonly [import("./types.js").StringType, import("@elaraai/east").StructType<{
|
|
1026
|
+
readonly table: import("./types.js").StringType;
|
|
1027
|
+
readonly columns: import("@elaraai/east").OptionType<import("@elaraai/east").ArrayType<import("./types.js").StringType>>;
|
|
1028
|
+
readonly rowOffset: import("@elaraai/east").OptionType<import("@elaraai/east").IntegerType>;
|
|
1029
|
+
readonly rowLimit: import("@elaraai/east").OptionType<import("@elaraai/east").IntegerType>;
|
|
1030
|
+
}>], import("@elaraai/east").ArrayType<"T">>;
|
|
1031
|
+
/**
|
|
1032
|
+
* Closes an Access database connection.
|
|
1033
|
+
*
|
|
1034
|
+
* Releases all resources associated with the connection.
|
|
1035
|
+
*
|
|
1036
|
+
* @example
|
|
1037
|
+
* ```ts
|
|
1038
|
+
* const cleanup = East.function([], NullType, $ => {
|
|
1039
|
+
* const config = $.let({
|
|
1040
|
+
* path: "./database.mdb",
|
|
1041
|
+
* password: variant('none', null),
|
|
1042
|
+
* });
|
|
1043
|
+
* const conn = $.let(SQL.Access.open(config));
|
|
1044
|
+
* // ... do work ...
|
|
1045
|
+
* $(SQL.Access.close(conn));
|
|
1046
|
+
* $.return(null);
|
|
1047
|
+
* });
|
|
1048
|
+
*
|
|
1049
|
+
* const compiled = East.compileAsync(cleanup.toIR(), SQL.Access.Implementation);
|
|
1050
|
+
* await compiled();
|
|
1051
|
+
* ```
|
|
1052
|
+
*/
|
|
1053
|
+
readonly close: import("@elaraai/east").AsyncPlatformDefinition<[import("./types.js").StringType], import("@elaraai/east").NullType>;
|
|
1054
|
+
/**
|
|
1055
|
+
* Closes all Access database connections.
|
|
1056
|
+
*
|
|
1057
|
+
* Closes all active Access connections and releases all resources.
|
|
1058
|
+
* Useful for test cleanup to ensure all connections are closed.
|
|
1059
|
+
*
|
|
1060
|
+
* @returns Null on success
|
|
1061
|
+
*
|
|
1062
|
+
* @example
|
|
1063
|
+
* ```ts
|
|
1064
|
+
* const cleanupAll = East.function([], NullType, $ => {
|
|
1065
|
+
* // ... test code that may have left connections open ...
|
|
1066
|
+
* $(SQL.Access.closeAll());
|
|
1067
|
+
* return $.return(null);
|
|
1068
|
+
* });
|
|
1069
|
+
*
|
|
1070
|
+
* const compiled = East.compileAsync(cleanupAll.toIR(), SQL.Access.Implementation);
|
|
1071
|
+
* await compiled();
|
|
1072
|
+
* ```
|
|
1073
|
+
*
|
|
1074
|
+
* @internal
|
|
1075
|
+
*/
|
|
1076
|
+
readonly closeAll: import("@elaraai/east").AsyncPlatformDefinition<[], import("@elaraai/east").NullType>;
|
|
1077
|
+
/**
|
|
1078
|
+
* Node.js implementation of Access platform functions.
|
|
1079
|
+
*
|
|
1080
|
+
* Pass this to East.compileAsync() to enable Access operations.
|
|
1081
|
+
*/
|
|
1082
|
+
readonly Implementation: import("@elaraai/east/internal").PlatformFunction[];
|
|
1083
|
+
/**
|
|
1084
|
+
* Type definitions for Access operations.
|
|
1085
|
+
*/
|
|
1086
|
+
readonly Types: {
|
|
1087
|
+
/**
|
|
1088
|
+
* Access connection configuration type.
|
|
1089
|
+
*/
|
|
1090
|
+
readonly Config: import("@elaraai/east").StructType<{
|
|
1091
|
+
readonly path: import("./types.js").StringType;
|
|
1092
|
+
readonly password: import("@elaraai/east").OptionType<import("./types.js").StringType>;
|
|
1093
|
+
}>;
|
|
1094
|
+
/**
|
|
1095
|
+
* Access query options type.
|
|
1096
|
+
*/
|
|
1097
|
+
readonly QueryOptions: import("@elaraai/east").StructType<{
|
|
1098
|
+
readonly table: import("./types.js").StringType;
|
|
1099
|
+
readonly columns: import("@elaraai/east").OptionType<import("@elaraai/east").ArrayType<import("./types.js").StringType>>;
|
|
1100
|
+
readonly rowOffset: import("@elaraai/east").OptionType<import("@elaraai/east").IntegerType>;
|
|
1101
|
+
readonly rowLimit: import("@elaraai/east").OptionType<import("@elaraai/east").IntegerType>;
|
|
1102
|
+
}>;
|
|
1103
|
+
/**
|
|
1104
|
+
* Access tables list result type.
|
|
1105
|
+
*/
|
|
1106
|
+
readonly TablesResult: import("@elaraai/east").StructType<{
|
|
1107
|
+
readonly tables: import("@elaraai/east").ArrayType<import("./types.js").StringType>;
|
|
1108
|
+
}>;
|
|
1109
|
+
};
|
|
1110
|
+
};
|
|
1111
|
+
};
|
|
1112
|
+
//# sourceMappingURL=index.d.ts.map
|