@elaraai/east-node-io 0.0.1-beta.0 → 0.0.1-beta.2

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.
Files changed (114) hide show
  1. package/dist/compression/gzip.d.ts +108 -0
  2. package/dist/compression/gzip.d.ts.map +1 -0
  3. package/dist/compression/gzip.js +153 -0
  4. package/dist/compression/gzip.js.map +1 -0
  5. package/dist/compression/index.d.ts +308 -0
  6. package/dist/compression/index.d.ts.map +1 -0
  7. package/dist/compression/index.js +289 -0
  8. package/dist/compression/index.js.map +1 -0
  9. package/dist/compression/tar.d.ts +115 -0
  10. package/dist/compression/tar.d.ts.map +1 -0
  11. package/dist/compression/tar.js +254 -0
  12. package/dist/compression/tar.js.map +1 -0
  13. package/dist/compression/types.d.ts +124 -0
  14. package/dist/compression/types.d.ts.map +1 -0
  15. package/dist/compression/types.js +106 -0
  16. package/dist/compression/types.js.map +1 -0
  17. package/dist/compression/zip.d.ts +121 -0
  18. package/dist/compression/zip.d.ts.map +1 -0
  19. package/dist/compression/zip.js +200 -0
  20. package/dist/compression/zip.js.map +1 -0
  21. package/dist/connection/index.d.ts +78 -0
  22. package/dist/connection/index.d.ts.map +1 -0
  23. package/dist/connection/index.js +134 -0
  24. package/dist/connection/index.js.map +1 -0
  25. package/dist/format/csv.d.ts +210 -0
  26. package/dist/format/csv.d.ts.map +1 -0
  27. package/dist/format/csv.js +729 -0
  28. package/dist/format/csv.js.map +1 -0
  29. package/dist/format/index.d.ts +641 -0
  30. package/dist/format/index.d.ts.map +1 -0
  31. package/dist/format/index.js +463 -0
  32. package/dist/format/index.js.map +1 -0
  33. package/dist/format/types.d.ts +176 -0
  34. package/dist/format/types.d.ts.map +1 -0
  35. package/dist/format/types.js +122 -0
  36. package/dist/format/types.js.map +1 -0
  37. package/dist/format/xlsx.d.ts +178 -0
  38. package/dist/format/xlsx.d.ts.map +1 -0
  39. package/dist/format/xlsx.js +313 -0
  40. package/dist/format/xlsx.js.map +1 -0
  41. package/dist/format/xml.d.ts +302 -0
  42. package/dist/format/xml.d.ts.map +1 -0
  43. package/dist/format/xml.js +602 -0
  44. package/dist/format/xml.js.map +1 -0
  45. package/dist/index.d.ts +25 -0
  46. package/dist/index.d.ts.map +1 -0
  47. package/dist/index.js +32 -0
  48. package/dist/index.js.map +1 -0
  49. package/dist/nosql/index.d.ts +503 -0
  50. package/dist/nosql/index.d.ts.map +1 -0
  51. package/dist/nosql/index.js +483 -0
  52. package/dist/nosql/index.js.map +1 -0
  53. package/dist/nosql/mongodb.d.ts +306 -0
  54. package/dist/nosql/mongodb.d.ts.map +1 -0
  55. package/dist/nosql/mongodb.js +552 -0
  56. package/dist/nosql/mongodb.js.map +1 -0
  57. package/dist/nosql/redis.d.ts +268 -0
  58. package/dist/nosql/redis.d.ts.map +1 -0
  59. package/dist/nosql/redis.js +371 -0
  60. package/dist/nosql/redis.js.map +1 -0
  61. package/dist/nosql/types.d.ts +70 -0
  62. package/dist/nosql/types.d.ts.map +1 -0
  63. package/dist/nosql/types.js +79 -0
  64. package/dist/nosql/types.js.map +1 -0
  65. package/dist/sql/index.d.ts +777 -0
  66. package/dist/sql/index.d.ts.map +1 -0
  67. package/dist/sql/index.js +515 -0
  68. package/dist/sql/index.js.map +1 -0
  69. package/dist/sql/mysql.d.ts +238 -0
  70. package/dist/sql/mysql.d.ts.map +1 -0
  71. package/dist/sql/mysql.js +396 -0
  72. package/dist/sql/mysql.js.map +1 -0
  73. package/dist/sql/postgres.d.ts +237 -0
  74. package/dist/sql/postgres.d.ts.map +1 -0
  75. package/dist/sql/postgres.js +381 -0
  76. package/dist/sql/postgres.js.map +1 -0
  77. package/dist/sql/sqlite.d.ts +217 -0
  78. package/dist/sql/sqlite.d.ts.map +1 -0
  79. package/dist/sql/sqlite.js +366 -0
  80. package/dist/sql/sqlite.js.map +1 -0
  81. package/dist/sql/types.d.ts +205 -0
  82. package/dist/sql/types.d.ts.map +1 -0
  83. package/dist/sql/types.js +175 -0
  84. package/dist/sql/types.js.map +1 -0
  85. package/dist/storage/index.d.ts +304 -0
  86. package/dist/storage/index.d.ts.map +1 -0
  87. package/dist/storage/index.js +234 -0
  88. package/dist/storage/index.js.map +1 -0
  89. package/dist/storage/s3.d.ts +373 -0
  90. package/dist/storage/s3.d.ts.map +1 -0
  91. package/dist/storage/s3.js +502 -0
  92. package/dist/storage/s3.js.map +1 -0
  93. package/dist/storage/types.d.ts +117 -0
  94. package/dist/storage/types.d.ts.map +1 -0
  95. package/dist/storage/types.js +94 -0
  96. package/dist/storage/types.js.map +1 -0
  97. package/dist/transfer/ftp.d.ts +333 -0
  98. package/dist/transfer/ftp.d.ts.map +1 -0
  99. package/dist/transfer/ftp.js +437 -0
  100. package/dist/transfer/ftp.js.map +1 -0
  101. package/dist/transfer/index.d.ts +456 -0
  102. package/dist/transfer/index.d.ts.map +1 -0
  103. package/dist/transfer/index.js +414 -0
  104. package/dist/transfer/index.js.map +1 -0
  105. package/dist/transfer/sftp.d.ts +333 -0
  106. package/dist/transfer/sftp.d.ts.map +1 -0
  107. package/dist/transfer/sftp.js +436 -0
  108. package/dist/transfer/sftp.js.map +1 -0
  109. package/dist/transfer/types.d.ts +108 -0
  110. package/dist/transfer/types.d.ts.map +1 -0
  111. package/dist/transfer/types.js +110 -0
  112. package/dist/transfer/types.js.map +1 -0
  113. package/dist/tsconfig.tsbuildinfo +1 -0
  114. package/package.json +8 -8
@@ -0,0 +1,777 @@
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 "./types.js";
17
+ /**
18
+ * SQL database platform functions.
19
+ *
20
+ * Provides type-safe SQL database operations for East programs, supporting
21
+ * SQLite, PostgreSQL, and MySQL with connection pooling and parameterized queries.
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * import { East, StringType, IntegerType, NullType, variant } from "@elaraai/east";
26
+ * import { SQL } from "@elaraai/east-node-io";
27
+ *
28
+ * const getUserName = East.function([IntegerType], NullType, ($, userId) => {
29
+ * const config = $.let({
30
+ * host: "localhost",
31
+ * port: 5432n,
32
+ * database: "myapp",
33
+ * user: "postgres",
34
+ * password: "secret",
35
+ * ssl: variant('none', null),
36
+ * maxConnections: variant('none', null),
37
+ * });
38
+ *
39
+ * const conn = $.let(SQL.Postgres.connect(config));
40
+ * $(SQL.Postgres.query(
41
+ * conn,
42
+ * "SELECT name FROM users WHERE id = $1",
43
+ * [variant('Integer', userId)]
44
+ * ));
45
+ * $(SQL.Postgres.close(conn));
46
+ * $.return(null);
47
+ * });
48
+ *
49
+ * // All SQL operations are async
50
+ * const compiled = East.compileAsync(getUserName.toIR(), SQL.Postgres.Implementation);
51
+ * await compiled(42n);
52
+ * ```
53
+ */
54
+ export declare const SQL: {
55
+ /**
56
+ * SQLite database operations.
57
+ *
58
+ * Provides platform functions for SQLite, a serverless embedded SQL database.
59
+ */
60
+ readonly SQLite: {
61
+ /**
62
+ * Opens a SQLite database connection.
63
+ *
64
+ * Creates a connection to a SQLite database file or in-memory database
65
+ * and returns an opaque handle for use in queries.
66
+ *
67
+ * @example
68
+ * ```ts
69
+ * const getUser = East.function([IntegerType], NullType, ($, userId) => {
70
+ * const config = $.let({
71
+ * path: "./mydb.sqlite",
72
+ * readOnly: variant('none', null),
73
+ * memory: variant('none', null),
74
+ * });
75
+ *
76
+ * const conn = $.let(SQL.SQLite.connect(config));
77
+ * $(SQL.SQLite.query(
78
+ * conn,
79
+ * "SELECT name FROM users WHERE id = ?",
80
+ * [variant('Integer', userId)]
81
+ * ));
82
+ * $(SQL.SQLite.close(conn));
83
+ * $.return(null);
84
+ * });
85
+ *
86
+ * const compiled = East.compileAsync(getUser.toIR(), SQL.SQLite.Implementation);
87
+ * await compiled(42n);
88
+ * ```
89
+ */
90
+ readonly connect: import("@elaraai/east").AsyncPlatformDefinition<[import("@elaraai/east").StructType<{
91
+ path: import("./types.js").StringType;
92
+ readOnly: import("@elaraai/east").OptionType<import("@elaraai/east").BooleanType>;
93
+ memory: import("@elaraai/east").OptionType<import("@elaraai/east").BooleanType>;
94
+ }>], import("./types.js").StringType>;
95
+ /**
96
+ * Executes a SQL query with parameters.
97
+ *
98
+ * Runs a SQL query with parameter binding using ? placeholders.
99
+ *
100
+ * @example
101
+ * ```ts
102
+ * const getUser = East.function([IntegerType], NullType, ($, userId) => {
103
+ * const config = $.let({
104
+ * path: "./mydb.sqlite",
105
+ * readOnly: variant('none', null),
106
+ * memory: variant('none', null),
107
+ * });
108
+ * const conn = $.let(SQL.SQLite.connect(config));
109
+ * $(SQL.SQLite.query(
110
+ * conn,
111
+ * "SELECT name FROM users WHERE id = ?",
112
+ * [variant('Integer', userId)]
113
+ * ));
114
+ * $(SQL.SQLite.close(conn));
115
+ * $.return(null);
116
+ * });
117
+ *
118
+ * const compiled = East.compileAsync(getUser.toIR(), SQL.SQLite.Implementation);
119
+ * await compiled(42n);
120
+ * ```
121
+ */
122
+ readonly query: import("@elaraai/east").AsyncPlatformDefinition<[import("./types.js").StringType, import("./types.js").StringType, import("@elaraai/east").ArrayType<import("@elaraai/east").VariantType<{
123
+ Null: import("@elaraai/east").NullType;
124
+ Boolean: import("@elaraai/east").BooleanType;
125
+ Integer: import("@elaraai/east").IntegerType;
126
+ Float: import("@elaraai/east").FloatType;
127
+ String: import("./types.js").StringType;
128
+ DateTime: import("@elaraai/east").DateTimeType;
129
+ Blob: import("@elaraai/east").BlobType;
130
+ }>>], import("@elaraai/east").VariantType<{
131
+ select: import("@elaraai/east").StructType<{
132
+ rows: import("@elaraai/east").ArrayType<import("@elaraai/east").DictType<import("./types.js").StringType, import("@elaraai/east").VariantType<{
133
+ Null: import("@elaraai/east").NullType;
134
+ Boolean: import("@elaraai/east").BooleanType;
135
+ Integer: import("@elaraai/east").IntegerType;
136
+ Float: import("@elaraai/east").FloatType;
137
+ String: import("./types.js").StringType;
138
+ DateTime: import("@elaraai/east").DateTimeType;
139
+ Blob: import("@elaraai/east").BlobType;
140
+ }>>>;
141
+ }>;
142
+ insert: import("@elaraai/east").StructType<{
143
+ rowsAffected: import("@elaraai/east").IntegerType;
144
+ lastInsertId: import("@elaraai/east").OptionType<import("@elaraai/east").IntegerType>;
145
+ }>;
146
+ update: import("@elaraai/east").StructType<{
147
+ rowsAffected: import("@elaraai/east").IntegerType;
148
+ }>;
149
+ delete: import("@elaraai/east").StructType<{
150
+ rowsAffected: import("@elaraai/east").IntegerType;
151
+ }>;
152
+ }>>;
153
+ /**
154
+ * Closes the SQLite database connection.
155
+ *
156
+ * Releases all resources associated with the connection.
157
+ *
158
+ * @example
159
+ * ```ts
160
+ * const cleanup = East.function([], NullType, $ => {
161
+ * const config = $.let({
162
+ * path: "./mydb.sqlite",
163
+ * readOnly: variant('none', null),
164
+ * memory: variant('none', null),
165
+ * });
166
+ * const conn = $.let(SQL.SQLite.connect(config));
167
+ * // ... do work ...
168
+ * $(SQL.SQLite.close(conn));
169
+ * $.return(null);
170
+ * });
171
+ *
172
+ * const compiled = East.compileAsync(cleanup.toIR(), SQL.SQLite.Implementation);
173
+ * await compiled();
174
+ * ```
175
+ */
176
+ readonly close: import("@elaraai/east").AsyncPlatformDefinition<[import("./types.js").StringType], import("@elaraai/east").NullType>;
177
+ /**
178
+ * Closes all SQLite connections.
179
+ *
180
+ * Closes all active SQLite connections and releases all resources.
181
+ * Useful for test cleanup to ensure all connections are closed.
182
+ *
183
+ * @returns Null on success
184
+ *
185
+ * @example
186
+ * ```ts
187
+ * const cleanupAll = East.function([], NullType, $ => {
188
+ * // ... test code that may have left connections open ...
189
+ * $(SQL.SQLite.closeAll());
190
+ * return $.return(null);
191
+ * });
192
+ *
193
+ * const compiled = East.compileAsync(cleanupAll.toIR(), SQL.SQLite.Implementation);
194
+ * await compiled();
195
+ * ```
196
+ *
197
+ * @internal
198
+ */
199
+ readonly closeAll: import("@elaraai/east").AsyncPlatformDefinition<[], import("@elaraai/east").NullType>;
200
+ /**
201
+ * Node.js implementation of SQLite platform functions.
202
+ *
203
+ * Pass this to East.compileAsync() to enable SQLite operations.
204
+ */
205
+ readonly Implementation: import("@elaraai/east/internal").PlatformFunction[];
206
+ /**
207
+ * Type definitions for SQLite operations.
208
+ */
209
+ readonly Types: {
210
+ /**
211
+ * SQLite connection configuration type.
212
+ */
213
+ readonly Config: import("@elaraai/east").StructType<{
214
+ path: import("./types.js").StringType;
215
+ readOnly: import("@elaraai/east").OptionType<import("@elaraai/east").BooleanType>;
216
+ memory: import("@elaraai/east").OptionType<import("@elaraai/east").BooleanType>;
217
+ }>;
218
+ /**
219
+ * SQL query parameter value type.
220
+ */
221
+ readonly Parameter: import("@elaraai/east").VariantType<{
222
+ Null: import("@elaraai/east").NullType;
223
+ Boolean: import("@elaraai/east").BooleanType;
224
+ Integer: import("@elaraai/east").IntegerType;
225
+ Float: import("@elaraai/east").FloatType;
226
+ String: import("./types.js").StringType;
227
+ DateTime: import("@elaraai/east").DateTimeType;
228
+ Blob: import("@elaraai/east").BlobType;
229
+ }>;
230
+ /**
231
+ * Array of SQL query parameters.
232
+ */
233
+ readonly Parameters: import("@elaraai/east").ArrayType<import("@elaraai/east").VariantType<{
234
+ Null: import("@elaraai/east").NullType;
235
+ Boolean: import("@elaraai/east").BooleanType;
236
+ Integer: import("@elaraai/east").IntegerType;
237
+ Float: import("@elaraai/east").FloatType;
238
+ String: import("./types.js").StringType;
239
+ DateTime: import("@elaraai/east").DateTimeType;
240
+ Blob: import("@elaraai/east").BlobType;
241
+ }>>;
242
+ /**
243
+ * SQL query result row type.
244
+ */
245
+ readonly Row: import("@elaraai/east").DictType<import("./types.js").StringType, import("@elaraai/east").VariantType<{
246
+ Null: import("@elaraai/east").NullType;
247
+ Boolean: import("@elaraai/east").BooleanType;
248
+ Integer: import("@elaraai/east").IntegerType;
249
+ Float: import("@elaraai/east").FloatType;
250
+ String: import("./types.js").StringType;
251
+ DateTime: import("@elaraai/east").DateTimeType;
252
+ Blob: import("@elaraai/east").BlobType;
253
+ }>>;
254
+ /**
255
+ * SQL query execution result type.
256
+ */
257
+ readonly Result: import("@elaraai/east").VariantType<{
258
+ select: import("@elaraai/east").StructType<{
259
+ rows: import("@elaraai/east").ArrayType<import("@elaraai/east").DictType<import("./types.js").StringType, import("@elaraai/east").VariantType<{
260
+ Null: import("@elaraai/east").NullType;
261
+ Boolean: import("@elaraai/east").BooleanType;
262
+ Integer: import("@elaraai/east").IntegerType;
263
+ Float: import("@elaraai/east").FloatType;
264
+ String: import("./types.js").StringType;
265
+ DateTime: import("@elaraai/east").DateTimeType;
266
+ Blob: import("@elaraai/east").BlobType;
267
+ }>>>;
268
+ }>;
269
+ insert: import("@elaraai/east").StructType<{
270
+ rowsAffected: import("@elaraai/east").IntegerType;
271
+ lastInsertId: import("@elaraai/east").OptionType<import("@elaraai/east").IntegerType>;
272
+ }>;
273
+ update: import("@elaraai/east").StructType<{
274
+ rowsAffected: import("@elaraai/east").IntegerType;
275
+ }>;
276
+ delete: import("@elaraai/east").StructType<{
277
+ rowsAffected: import("@elaraai/east").IntegerType;
278
+ }>;
279
+ }>;
280
+ };
281
+ };
282
+ /**
283
+ * PostgreSQL database operations.
284
+ *
285
+ * Provides platform functions for PostgreSQL with connection pooling.
286
+ */
287
+ readonly Postgres: {
288
+ /**
289
+ * Connects to a PostgreSQL database.
290
+ *
291
+ * Creates a connection pool to a PostgreSQL database and returns an
292
+ * opaque handle for use in queries.
293
+ *
294
+ * @example
295
+ * ```ts
296
+ * const getUser = East.function([IntegerType], NullType, ($, userId) => {
297
+ * const config = $.let({
298
+ * host: "localhost",
299
+ * port: 5432n,
300
+ * database: "myapp",
301
+ * user: "postgres",
302
+ * password: "secret",
303
+ * ssl: variant('none', null),
304
+ * maxConnections: variant('none', null),
305
+ * });
306
+ *
307
+ * const conn = $.let(SQL.Postgres.connect(config));
308
+ * $(SQL.Postgres.query(
309
+ * conn,
310
+ * "SELECT name FROM users WHERE id = $1",
311
+ * [variant('Integer', userId)]
312
+ * ));
313
+ * $(SQL.Postgres.close(conn));
314
+ * $.return(null);
315
+ * });
316
+ *
317
+ * const compiled = East.compileAsync(getUser.toIR(), SQL.Postgres.Implementation);
318
+ * await compiled(42n);
319
+ * ```
320
+ */
321
+ readonly connect: import("@elaraai/east").AsyncPlatformDefinition<[import("@elaraai/east").StructType<{
322
+ host: import("./types.js").StringType;
323
+ port: import("@elaraai/east").IntegerType;
324
+ database: import("./types.js").StringType;
325
+ user: import("./types.js").StringType;
326
+ password: import("./types.js").StringType;
327
+ ssl: import("@elaraai/east").OptionType<import("@elaraai/east").BooleanType>;
328
+ maxConnections: import("@elaraai/east").OptionType<import("@elaraai/east").IntegerType>;
329
+ }>], import("./types.js").StringType>;
330
+ /**
331
+ * Executes a SQL query with parameters.
332
+ *
333
+ * Runs a SQL query with parameter binding using $1, $2, etc. placeholders.
334
+ *
335
+ * @example
336
+ * ```ts
337
+ * const getUser = East.function([IntegerType], NullType, ($, userId) => {
338
+ * const config = $.let({
339
+ * host: "localhost",
340
+ * port: 5432n,
341
+ * database: "myapp",
342
+ * user: "postgres",
343
+ * password: "secret",
344
+ * ssl: variant('none', null),
345
+ * maxConnections: variant('none', null),
346
+ * });
347
+ * const conn = $.let(SQL.Postgres.connect(config));
348
+ * $(SQL.Postgres.query(
349
+ * conn,
350
+ * "SELECT name FROM users WHERE id = $1",
351
+ * [variant('Integer', userId)]
352
+ * ));
353
+ * $(SQL.Postgres.close(conn));
354
+ * $.return(null);
355
+ * });
356
+ *
357
+ * const compiled = East.compileAsync(getUser.toIR(), SQL.Postgres.Implementation);
358
+ * await compiled(42n);
359
+ * ```
360
+ */
361
+ readonly query: import("@elaraai/east").AsyncPlatformDefinition<[import("./types.js").StringType, import("./types.js").StringType, import("@elaraai/east").ArrayType<import("@elaraai/east").VariantType<{
362
+ Null: import("@elaraai/east").NullType;
363
+ Boolean: import("@elaraai/east").BooleanType;
364
+ Integer: import("@elaraai/east").IntegerType;
365
+ Float: import("@elaraai/east").FloatType;
366
+ String: import("./types.js").StringType;
367
+ DateTime: import("@elaraai/east").DateTimeType;
368
+ Blob: import("@elaraai/east").BlobType;
369
+ }>>], import("@elaraai/east").VariantType<{
370
+ select: import("@elaraai/east").StructType<{
371
+ rows: import("@elaraai/east").ArrayType<import("@elaraai/east").DictType<import("./types.js").StringType, import("@elaraai/east").VariantType<{
372
+ Null: import("@elaraai/east").NullType;
373
+ Boolean: import("@elaraai/east").BooleanType;
374
+ Integer: import("@elaraai/east").IntegerType;
375
+ Float: import("@elaraai/east").FloatType;
376
+ String: import("./types.js").StringType;
377
+ DateTime: import("@elaraai/east").DateTimeType;
378
+ Blob: import("@elaraai/east").BlobType;
379
+ }>>>;
380
+ }>;
381
+ insert: import("@elaraai/east").StructType<{
382
+ rowsAffected: import("@elaraai/east").IntegerType;
383
+ lastInsertId: import("@elaraai/east").OptionType<import("@elaraai/east").IntegerType>;
384
+ }>;
385
+ update: import("@elaraai/east").StructType<{
386
+ rowsAffected: import("@elaraai/east").IntegerType;
387
+ }>;
388
+ delete: import("@elaraai/east").StructType<{
389
+ rowsAffected: import("@elaraai/east").IntegerType;
390
+ }>;
391
+ }>>;
392
+ /**
393
+ * Closes the PostgreSQL connection pool.
394
+ *
395
+ * Terminates all connections and releases all resources.
396
+ *
397
+ * @example
398
+ * ```ts
399
+ * const cleanup = East.function([], NullType, $ => {
400
+ * const config = $.let({
401
+ * host: "localhost",
402
+ * port: 5432n,
403
+ * database: "myapp",
404
+ * user: "postgres",
405
+ * password: "secret",
406
+ * ssl: variant('none', null),
407
+ * maxConnections: variant('none', null),
408
+ * });
409
+ * const conn = $.let(SQL.Postgres.connect(config));
410
+ * // ... do work ...
411
+ * $(SQL.Postgres.close(conn));
412
+ * $.return(null);
413
+ * });
414
+ *
415
+ * const compiled = East.compileAsync(cleanup.toIR(), SQL.Postgres.Implementation);
416
+ * await compiled();
417
+ * ```
418
+ */
419
+ readonly close: import("@elaraai/east").AsyncPlatformDefinition<[import("./types.js").StringType], import("@elaraai/east").NullType>;
420
+ /**
421
+ * Closes all PostgreSQL connections.
422
+ *
423
+ * Closes all active PostgreSQL connection pools and releases all resources.
424
+ * Useful for test cleanup to ensure all connections are closed.
425
+ *
426
+ * @returns Null on success
427
+ *
428
+ * @example
429
+ * ```ts
430
+ * const cleanupAll = East.function([], NullType, $ => {
431
+ * // ... test code that may have left connections open ...
432
+ * $(SQL.Postgres.closeAll());
433
+ * return $.return(null);
434
+ * });
435
+ *
436
+ * const compiled = East.compileAsync(cleanupAll.toIR(), SQL.Postgres.Implementation);
437
+ * await compiled();
438
+ * ```
439
+ *
440
+ * @internal
441
+ */
442
+ readonly closeAll: import("@elaraai/east").AsyncPlatformDefinition<[], import("@elaraai/east").NullType>;
443
+ /**
444
+ * Node.js implementation of PostgreSQL platform functions.
445
+ *
446
+ * Pass this to East.compileAsync() to enable PostgreSQL operations.
447
+ */
448
+ readonly Implementation: import("@elaraai/east/internal").PlatformFunction[];
449
+ /**
450
+ * Type definitions for PostgreSQL operations.
451
+ */
452
+ readonly Types: {
453
+ /**
454
+ * PostgreSQL connection configuration type.
455
+ */
456
+ readonly Config: import("@elaraai/east").StructType<{
457
+ host: import("./types.js").StringType;
458
+ port: import("@elaraai/east").IntegerType;
459
+ database: import("./types.js").StringType;
460
+ user: import("./types.js").StringType;
461
+ password: import("./types.js").StringType;
462
+ ssl: import("@elaraai/east").OptionType<import("@elaraai/east").BooleanType>;
463
+ maxConnections: import("@elaraai/east").OptionType<import("@elaraai/east").IntegerType>;
464
+ }>;
465
+ /**
466
+ * SQL query parameter value type.
467
+ */
468
+ readonly Parameter: import("@elaraai/east").VariantType<{
469
+ Null: import("@elaraai/east").NullType;
470
+ Boolean: import("@elaraai/east").BooleanType;
471
+ Integer: import("@elaraai/east").IntegerType;
472
+ Float: import("@elaraai/east").FloatType;
473
+ String: import("./types.js").StringType;
474
+ DateTime: import("@elaraai/east").DateTimeType;
475
+ Blob: import("@elaraai/east").BlobType;
476
+ }>;
477
+ /**
478
+ * Array of SQL query parameters.
479
+ */
480
+ readonly Parameters: import("@elaraai/east").ArrayType<import("@elaraai/east").VariantType<{
481
+ Null: import("@elaraai/east").NullType;
482
+ Boolean: import("@elaraai/east").BooleanType;
483
+ Integer: import("@elaraai/east").IntegerType;
484
+ Float: import("@elaraai/east").FloatType;
485
+ String: import("./types.js").StringType;
486
+ DateTime: import("@elaraai/east").DateTimeType;
487
+ Blob: import("@elaraai/east").BlobType;
488
+ }>>;
489
+ /**
490
+ * SQL query result row type.
491
+ */
492
+ readonly Row: import("@elaraai/east").DictType<import("./types.js").StringType, import("@elaraai/east").VariantType<{
493
+ Null: import("@elaraai/east").NullType;
494
+ Boolean: import("@elaraai/east").BooleanType;
495
+ Integer: import("@elaraai/east").IntegerType;
496
+ Float: import("@elaraai/east").FloatType;
497
+ String: import("./types.js").StringType;
498
+ DateTime: import("@elaraai/east").DateTimeType;
499
+ Blob: import("@elaraai/east").BlobType;
500
+ }>>;
501
+ /**
502
+ * SQL query execution result type.
503
+ */
504
+ readonly Result: import("@elaraai/east").VariantType<{
505
+ select: import("@elaraai/east").StructType<{
506
+ rows: import("@elaraai/east").ArrayType<import("@elaraai/east").DictType<import("./types.js").StringType, import("@elaraai/east").VariantType<{
507
+ Null: import("@elaraai/east").NullType;
508
+ Boolean: import("@elaraai/east").BooleanType;
509
+ Integer: import("@elaraai/east").IntegerType;
510
+ Float: import("@elaraai/east").FloatType;
511
+ String: import("./types.js").StringType;
512
+ DateTime: import("@elaraai/east").DateTimeType;
513
+ Blob: import("@elaraai/east").BlobType;
514
+ }>>>;
515
+ }>;
516
+ insert: import("@elaraai/east").StructType<{
517
+ rowsAffected: import("@elaraai/east").IntegerType;
518
+ lastInsertId: import("@elaraai/east").OptionType<import("@elaraai/east").IntegerType>;
519
+ }>;
520
+ update: import("@elaraai/east").StructType<{
521
+ rowsAffected: import("@elaraai/east").IntegerType;
522
+ }>;
523
+ delete: import("@elaraai/east").StructType<{
524
+ rowsAffected: import("@elaraai/east").IntegerType;
525
+ }>;
526
+ }>;
527
+ };
528
+ };
529
+ /**
530
+ * MySQL database operations.
531
+ *
532
+ * Provides platform functions for MySQL with connection pooling.
533
+ */
534
+ readonly MySQL: {
535
+ /**
536
+ * Connects to a MySQL database.
537
+ *
538
+ * Creates a connection pool to a MySQL database and returns an
539
+ * opaque handle for use in queries.
540
+ *
541
+ * @example
542
+ * ```ts
543
+ * const getUser = East.function([IntegerType], NullType, ($, userId) => {
544
+ * const config = $.let({
545
+ * host: "localhost",
546
+ * port: 3306n,
547
+ * database: "myapp",
548
+ * user: "root",
549
+ * password: "secret",
550
+ * ssl: variant('none', null),
551
+ * maxConnections: variant('none', null),
552
+ * });
553
+ *
554
+ * const conn = $.let(SQL.MySQL.connect(config));
555
+ * $(SQL.MySQL.query(
556
+ * conn,
557
+ * "SELECT name FROM users WHERE id = ?",
558
+ * [variant('Integer', userId)]
559
+ * ));
560
+ * $(SQL.MySQL.close(conn));
561
+ * $.return(null);
562
+ * });
563
+ *
564
+ * const compiled = East.compileAsync(getUser.toIR(), SQL.MySQL.Implementation);
565
+ * await compiled(42n);
566
+ * ```
567
+ */
568
+ readonly connect: import("@elaraai/east").AsyncPlatformDefinition<[import("@elaraai/east").StructType<{
569
+ host: import("./types.js").StringType;
570
+ port: import("@elaraai/east").IntegerType;
571
+ database: import("./types.js").StringType;
572
+ user: import("./types.js").StringType;
573
+ password: import("./types.js").StringType;
574
+ ssl: import("@elaraai/east").OptionType<import("@elaraai/east").BooleanType>;
575
+ maxConnections: import("@elaraai/east").OptionType<import("@elaraai/east").IntegerType>;
576
+ }>], import("./types.js").StringType>;
577
+ /**
578
+ * Executes a SQL query with parameters.
579
+ *
580
+ * Runs a SQL query with parameter binding using ? placeholders.
581
+ *
582
+ * @example
583
+ * ```ts
584
+ * const getUser = East.function([IntegerType], NullType, ($, userId) => {
585
+ * const config = $.let({
586
+ * host: "localhost",
587
+ * port: 3306n,
588
+ * database: "myapp",
589
+ * user: "root",
590
+ * password: "secret",
591
+ * ssl: variant('none', null),
592
+ * maxConnections: variant('none', null),
593
+ * });
594
+ * const conn = $.let(SQL.MySQL.connect(config));
595
+ * $(SQL.MySQL.query(
596
+ * conn,
597
+ * "SELECT name FROM users WHERE id = ?",
598
+ * [variant('Integer', userId)]
599
+ * ));
600
+ * $(SQL.MySQL.close(conn));
601
+ * $.return(null);
602
+ * });
603
+ *
604
+ * const compiled = East.compileAsync(getUser.toIR(), SQL.MySQL.Implementation);
605
+ * await compiled(42n);
606
+ * ```
607
+ */
608
+ readonly query: import("@elaraai/east").AsyncPlatformDefinition<[import("./types.js").StringType, import("./types.js").StringType, import("@elaraai/east").ArrayType<import("@elaraai/east").VariantType<{
609
+ Null: import("@elaraai/east").NullType;
610
+ Boolean: import("@elaraai/east").BooleanType;
611
+ Integer: import("@elaraai/east").IntegerType;
612
+ Float: import("@elaraai/east").FloatType;
613
+ String: import("./types.js").StringType;
614
+ DateTime: import("@elaraai/east").DateTimeType;
615
+ Blob: import("@elaraai/east").BlobType;
616
+ }>>], import("@elaraai/east").VariantType<{
617
+ select: import("@elaraai/east").StructType<{
618
+ rows: import("@elaraai/east").ArrayType<import("@elaraai/east").DictType<import("./types.js").StringType, import("@elaraai/east").VariantType<{
619
+ Null: import("@elaraai/east").NullType;
620
+ Boolean: import("@elaraai/east").BooleanType;
621
+ Integer: import("@elaraai/east").IntegerType;
622
+ Float: import("@elaraai/east").FloatType;
623
+ String: import("./types.js").StringType;
624
+ DateTime: import("@elaraai/east").DateTimeType;
625
+ Blob: import("@elaraai/east").BlobType;
626
+ }>>>;
627
+ }>;
628
+ insert: import("@elaraai/east").StructType<{
629
+ rowsAffected: import("@elaraai/east").IntegerType;
630
+ lastInsertId: import("@elaraai/east").OptionType<import("@elaraai/east").IntegerType>;
631
+ }>;
632
+ update: import("@elaraai/east").StructType<{
633
+ rowsAffected: import("@elaraai/east").IntegerType;
634
+ }>;
635
+ delete: import("@elaraai/east").StructType<{
636
+ rowsAffected: import("@elaraai/east").IntegerType;
637
+ }>;
638
+ }>>;
639
+ /**
640
+ * Closes the MySQL connection pool.
641
+ *
642
+ * Terminates all connections and releases all resources.
643
+ *
644
+ * @example
645
+ * ```ts
646
+ * const cleanup = East.function([], NullType, $ => {
647
+ * const config = $.let({
648
+ * host: "localhost",
649
+ * port: 3306n,
650
+ * database: "myapp",
651
+ * user: "root",
652
+ * password: "secret",
653
+ * ssl: variant('none', null),
654
+ * maxConnections: variant('none', null),
655
+ * });
656
+ * const conn = $.let(SQL.MySQL.connect(config));
657
+ * // ... do work ...
658
+ * $(SQL.MySQL.close(conn));
659
+ * $.return(null);
660
+ * });
661
+ *
662
+ * const compiled = East.compileAsync(cleanup.toIR(), SQL.MySQL.Implementation);
663
+ * await compiled();
664
+ * ```
665
+ */
666
+ readonly close: import("@elaraai/east").AsyncPlatformDefinition<[import("./types.js").StringType], import("@elaraai/east").NullType>;
667
+ /**
668
+ * Closes all MySQL connections.
669
+ *
670
+ * Closes all active MySQL connection pools and releases all resources.
671
+ * Useful for test cleanup to ensure all connections are closed.
672
+ *
673
+ * @returns Null on success
674
+ *
675
+ * @example
676
+ * ```ts
677
+ * const cleanupAll = East.function([], NullType, $ => {
678
+ * // ... test code that may have left connections open ...
679
+ * $(SQL.MySQL.closeAll());
680
+ * return $.return(null);
681
+ * });
682
+ *
683
+ * const compiled = East.compileAsync(cleanupAll.toIR(), SQL.MySQL.Implementation);
684
+ * await compiled();
685
+ * ```
686
+ *
687
+ * @internal
688
+ */
689
+ readonly closeAll: import("@elaraai/east").AsyncPlatformDefinition<[], import("@elaraai/east").NullType>;
690
+ /**
691
+ * Node.js implementation of MySQL platform functions.
692
+ *
693
+ * Pass this to East.compileAsync() to enable MySQL operations.
694
+ */
695
+ readonly Implementation: import("@elaraai/east/internal").PlatformFunction[];
696
+ /**
697
+ * Type definitions for MySQL operations.
698
+ */
699
+ readonly Types: {
700
+ /**
701
+ * MySQL connection configuration type.
702
+ */
703
+ readonly Config: import("@elaraai/east").StructType<{
704
+ host: import("./types.js").StringType;
705
+ port: import("@elaraai/east").IntegerType;
706
+ database: import("./types.js").StringType;
707
+ user: import("./types.js").StringType;
708
+ password: import("./types.js").StringType;
709
+ ssl: import("@elaraai/east").OptionType<import("@elaraai/east").BooleanType>;
710
+ maxConnections: import("@elaraai/east").OptionType<import("@elaraai/east").IntegerType>;
711
+ }>;
712
+ /**
713
+ * SQL query parameter value type.
714
+ */
715
+ readonly Parameter: import("@elaraai/east").VariantType<{
716
+ Null: import("@elaraai/east").NullType;
717
+ Boolean: import("@elaraai/east").BooleanType;
718
+ Integer: import("@elaraai/east").IntegerType;
719
+ Float: import("@elaraai/east").FloatType;
720
+ String: import("./types.js").StringType;
721
+ DateTime: import("@elaraai/east").DateTimeType;
722
+ Blob: import("@elaraai/east").BlobType;
723
+ }>;
724
+ /**
725
+ * Array of SQL query parameters.
726
+ */
727
+ readonly Parameters: import("@elaraai/east").ArrayType<import("@elaraai/east").VariantType<{
728
+ Null: import("@elaraai/east").NullType;
729
+ Boolean: import("@elaraai/east").BooleanType;
730
+ Integer: import("@elaraai/east").IntegerType;
731
+ Float: import("@elaraai/east").FloatType;
732
+ String: import("./types.js").StringType;
733
+ DateTime: import("@elaraai/east").DateTimeType;
734
+ Blob: import("@elaraai/east").BlobType;
735
+ }>>;
736
+ /**
737
+ * SQL query result row type.
738
+ */
739
+ readonly Row: import("@elaraai/east").DictType<import("./types.js").StringType, import("@elaraai/east").VariantType<{
740
+ Null: import("@elaraai/east").NullType;
741
+ Boolean: import("@elaraai/east").BooleanType;
742
+ Integer: import("@elaraai/east").IntegerType;
743
+ Float: import("@elaraai/east").FloatType;
744
+ String: import("./types.js").StringType;
745
+ DateTime: import("@elaraai/east").DateTimeType;
746
+ Blob: import("@elaraai/east").BlobType;
747
+ }>>;
748
+ /**
749
+ * SQL query execution result type.
750
+ */
751
+ readonly Result: import("@elaraai/east").VariantType<{
752
+ select: import("@elaraai/east").StructType<{
753
+ rows: import("@elaraai/east").ArrayType<import("@elaraai/east").DictType<import("./types.js").StringType, import("@elaraai/east").VariantType<{
754
+ Null: import("@elaraai/east").NullType;
755
+ Boolean: import("@elaraai/east").BooleanType;
756
+ Integer: import("@elaraai/east").IntegerType;
757
+ Float: import("@elaraai/east").FloatType;
758
+ String: import("./types.js").StringType;
759
+ DateTime: import("@elaraai/east").DateTimeType;
760
+ Blob: import("@elaraai/east").BlobType;
761
+ }>>>;
762
+ }>;
763
+ insert: import("@elaraai/east").StructType<{
764
+ rowsAffected: import("@elaraai/east").IntegerType;
765
+ lastInsertId: import("@elaraai/east").OptionType<import("@elaraai/east").IntegerType>;
766
+ }>;
767
+ update: import("@elaraai/east").StructType<{
768
+ rowsAffected: import("@elaraai/east").IntegerType;
769
+ }>;
770
+ delete: import("@elaraai/east").StructType<{
771
+ rowsAffected: import("@elaraai/east").IntegerType;
772
+ }>;
773
+ }>;
774
+ };
775
+ };
776
+ };
777
+ //# sourceMappingURL=index.d.ts.map