@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.
- package/dist/compression/gzip.d.ts +108 -0
- package/dist/compression/gzip.d.ts.map +1 -0
- package/dist/compression/gzip.js +153 -0
- package/dist/compression/gzip.js.map +1 -0
- package/dist/compression/index.d.ts +308 -0
- package/dist/compression/index.d.ts.map +1 -0
- package/dist/compression/index.js +289 -0
- package/dist/compression/index.js.map +1 -0
- package/dist/compression/tar.d.ts +115 -0
- package/dist/compression/tar.d.ts.map +1 -0
- package/dist/compression/tar.js +254 -0
- package/dist/compression/tar.js.map +1 -0
- package/dist/compression/types.d.ts +124 -0
- package/dist/compression/types.d.ts.map +1 -0
- package/dist/compression/types.js +106 -0
- package/dist/compression/types.js.map +1 -0
- package/dist/compression/zip.d.ts +121 -0
- package/dist/compression/zip.d.ts.map +1 -0
- package/dist/compression/zip.js +200 -0
- package/dist/compression/zip.js.map +1 -0
- package/dist/connection/index.d.ts +78 -0
- package/dist/connection/index.d.ts.map +1 -0
- package/dist/connection/index.js +134 -0
- package/dist/connection/index.js.map +1 -0
- package/dist/format/csv.d.ts +210 -0
- package/dist/format/csv.d.ts.map +1 -0
- package/dist/format/csv.js +729 -0
- package/dist/format/csv.js.map +1 -0
- package/dist/format/index.d.ts +641 -0
- package/dist/format/index.d.ts.map +1 -0
- package/dist/format/index.js +463 -0
- package/dist/format/index.js.map +1 -0
- package/dist/format/types.d.ts +176 -0
- package/dist/format/types.d.ts.map +1 -0
- package/dist/format/types.js +122 -0
- package/dist/format/types.js.map +1 -0
- package/dist/format/xlsx.d.ts +178 -0
- package/dist/format/xlsx.d.ts.map +1 -0
- package/dist/format/xlsx.js +313 -0
- package/dist/format/xlsx.js.map +1 -0
- package/dist/format/xml.d.ts +302 -0
- package/dist/format/xml.d.ts.map +1 -0
- package/dist/format/xml.js +602 -0
- package/dist/format/xml.js.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +32 -0
- package/dist/index.js.map +1 -0
- package/dist/nosql/index.d.ts +503 -0
- package/dist/nosql/index.d.ts.map +1 -0
- package/dist/nosql/index.js +483 -0
- package/dist/nosql/index.js.map +1 -0
- package/dist/nosql/mongodb.d.ts +306 -0
- package/dist/nosql/mongodb.d.ts.map +1 -0
- package/dist/nosql/mongodb.js +552 -0
- package/dist/nosql/mongodb.js.map +1 -0
- package/dist/nosql/redis.d.ts +268 -0
- package/dist/nosql/redis.d.ts.map +1 -0
- package/dist/nosql/redis.js +371 -0
- package/dist/nosql/redis.js.map +1 -0
- package/dist/nosql/types.d.ts +70 -0
- package/dist/nosql/types.d.ts.map +1 -0
- package/dist/nosql/types.js +79 -0
- package/dist/nosql/types.js.map +1 -0
- package/dist/sql/index.d.ts +777 -0
- package/dist/sql/index.d.ts.map +1 -0
- package/dist/sql/index.js +515 -0
- package/dist/sql/index.js.map +1 -0
- package/dist/sql/mysql.d.ts +238 -0
- package/dist/sql/mysql.d.ts.map +1 -0
- package/dist/sql/mysql.js +396 -0
- package/dist/sql/mysql.js.map +1 -0
- package/dist/sql/postgres.d.ts +237 -0
- package/dist/sql/postgres.d.ts.map +1 -0
- package/dist/sql/postgres.js +381 -0
- package/dist/sql/postgres.js.map +1 -0
- package/dist/sql/sqlite.d.ts +217 -0
- package/dist/sql/sqlite.d.ts.map +1 -0
- package/dist/sql/sqlite.js +366 -0
- package/dist/sql/sqlite.js.map +1 -0
- package/dist/sql/types.d.ts +205 -0
- package/dist/sql/types.d.ts.map +1 -0
- package/dist/sql/types.js +175 -0
- package/dist/sql/types.js.map +1 -0
- package/dist/storage/index.d.ts +304 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +234 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/s3.d.ts +373 -0
- package/dist/storage/s3.d.ts.map +1 -0
- package/dist/storage/s3.js +502 -0
- package/dist/storage/s3.js.map +1 -0
- package/dist/storage/types.d.ts +117 -0
- package/dist/storage/types.d.ts.map +1 -0
- package/dist/storage/types.js +94 -0
- package/dist/storage/types.js.map +1 -0
- package/dist/transfer/ftp.d.ts +333 -0
- package/dist/transfer/ftp.d.ts.map +1 -0
- package/dist/transfer/ftp.js +437 -0
- package/dist/transfer/ftp.js.map +1 -0
- package/dist/transfer/index.d.ts +456 -0
- package/dist/transfer/index.d.ts.map +1 -0
- package/dist/transfer/index.js +414 -0
- package/dist/transfer/index.js.map +1 -0
- package/dist/transfer/sftp.d.ts +333 -0
- package/dist/transfer/sftp.d.ts.map +1 -0
- package/dist/transfer/sftp.js +436 -0
- package/dist/transfer/sftp.js.map +1 -0
- package/dist/transfer/types.d.ts +108 -0
- package/dist/transfer/types.d.ts.map +1 -0
- package/dist/transfer/types.js +110 -0
- package/dist/transfer/types.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +8 -8
|
@@ -0,0 +1,205 @@
|
|
|
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
|
+
* Shared SQL type definitions for East Node IO.
|
|
7
|
+
*
|
|
8
|
+
* Provides East type definitions for SQL database operations including
|
|
9
|
+
* connection configurations, query parameters, and result types.
|
|
10
|
+
*
|
|
11
|
+
* @packageDocumentation
|
|
12
|
+
*/
|
|
13
|
+
import { StructType, VariantType, OptionType, ArrayType, DictType, StringType, IntegerType, BooleanType } from "@elaraai/east";
|
|
14
|
+
export { StringType } from "@elaraai/east";
|
|
15
|
+
/**
|
|
16
|
+
* SQLite database connection configuration.
|
|
17
|
+
*
|
|
18
|
+
* Configures a connection to a SQLite database file or in-memory database.
|
|
19
|
+
*/
|
|
20
|
+
export declare const SqliteConfigType: StructType<{
|
|
21
|
+
/**
|
|
22
|
+
* Path to the SQLite database file.
|
|
23
|
+
* Use ":memory:" for in-memory database.
|
|
24
|
+
*/
|
|
25
|
+
path: StringType;
|
|
26
|
+
/**
|
|
27
|
+
* Open database in read-only mode.
|
|
28
|
+
* Optional, defaults to false (read-write).
|
|
29
|
+
*/
|
|
30
|
+
readOnly: OptionType<BooleanType>;
|
|
31
|
+
/**
|
|
32
|
+
* Use in-memory database.
|
|
33
|
+
* Optional, defaults to false.
|
|
34
|
+
*/
|
|
35
|
+
memory: OptionType<BooleanType>;
|
|
36
|
+
}>;
|
|
37
|
+
/**
|
|
38
|
+
* PostgreSQL database connection configuration.
|
|
39
|
+
*
|
|
40
|
+
* Configures a connection pool to a PostgreSQL database server.
|
|
41
|
+
*/
|
|
42
|
+
export declare const PostgresConfigType: StructType<{
|
|
43
|
+
/** PostgreSQL server hostname or IP address */
|
|
44
|
+
host: StringType;
|
|
45
|
+
/** PostgreSQL server port (typically 5432) */
|
|
46
|
+
port: IntegerType;
|
|
47
|
+
/** Database name to connect to */
|
|
48
|
+
database: StringType;
|
|
49
|
+
/** Username for authentication */
|
|
50
|
+
user: StringType;
|
|
51
|
+
/** Password for authentication */
|
|
52
|
+
password: StringType;
|
|
53
|
+
/**
|
|
54
|
+
* Enable SSL/TLS connection.
|
|
55
|
+
* Optional, defaults to false.
|
|
56
|
+
*/
|
|
57
|
+
ssl: OptionType<BooleanType>;
|
|
58
|
+
/**
|
|
59
|
+
* Maximum number of connections in the pool.
|
|
60
|
+
* Optional, defaults to 10.
|
|
61
|
+
*/
|
|
62
|
+
maxConnections: OptionType<IntegerType>;
|
|
63
|
+
}>;
|
|
64
|
+
/**
|
|
65
|
+
* MySQL database connection configuration.
|
|
66
|
+
*
|
|
67
|
+
* Configures a connection pool to a MySQL database server.
|
|
68
|
+
*/
|
|
69
|
+
export declare const MySqlConfigType: StructType<{
|
|
70
|
+
/** MySQL server hostname or IP address */
|
|
71
|
+
host: StringType;
|
|
72
|
+
/** MySQL server port (typically 3306) */
|
|
73
|
+
port: IntegerType;
|
|
74
|
+
/** Database name to connect to */
|
|
75
|
+
database: StringType;
|
|
76
|
+
/** Username for authentication */
|
|
77
|
+
user: StringType;
|
|
78
|
+
/** Password for authentication */
|
|
79
|
+
password: StringType;
|
|
80
|
+
/**
|
|
81
|
+
* Enable SSL/TLS connection.
|
|
82
|
+
* Optional, defaults to false.
|
|
83
|
+
*/
|
|
84
|
+
ssl: OptionType<BooleanType>;
|
|
85
|
+
/**
|
|
86
|
+
* Maximum number of connections in the pool.
|
|
87
|
+
* Optional, defaults to 10.
|
|
88
|
+
*/
|
|
89
|
+
maxConnections: OptionType<IntegerType>;
|
|
90
|
+
}>;
|
|
91
|
+
/**
|
|
92
|
+
* SQL query parameter value type.
|
|
93
|
+
*
|
|
94
|
+
* Represents a typed value that can be used as a parameter in SQL queries.
|
|
95
|
+
* Supports all common SQL types with proper type safety.
|
|
96
|
+
*
|
|
97
|
+
* @remarks
|
|
98
|
+
* Use East.variant() to create parameter values:
|
|
99
|
+
* - `East.variant("string", "text")`
|
|
100
|
+
* - `East.variant("int", 42n)`
|
|
101
|
+
* - `East.variant("float", 3.14)`
|
|
102
|
+
* - `East.variant("bool", true)`
|
|
103
|
+
* - `East.variant("null", {})`
|
|
104
|
+
* - `East.variant("blob", new Uint8Array([1, 2, 3]))`
|
|
105
|
+
*/
|
|
106
|
+
export declare const SqlParameterType: VariantType<{
|
|
107
|
+
Null: import("@elaraai/east").NullType;
|
|
108
|
+
Boolean: BooleanType;
|
|
109
|
+
Integer: IntegerType;
|
|
110
|
+
Float: import("@elaraai/east").FloatType;
|
|
111
|
+
String: StringType;
|
|
112
|
+
DateTime: import("@elaraai/east").DateTimeType;
|
|
113
|
+
Blob: import("@elaraai/east").BlobType;
|
|
114
|
+
}>;
|
|
115
|
+
/**
|
|
116
|
+
* Array of SQL query parameters.
|
|
117
|
+
*
|
|
118
|
+
* Used to pass parameters to parameterized SQL queries.
|
|
119
|
+
*/
|
|
120
|
+
export declare const SqlParametersType: ArrayType<VariantType<{
|
|
121
|
+
Null: import("@elaraai/east").NullType;
|
|
122
|
+
Boolean: BooleanType;
|
|
123
|
+
Integer: IntegerType;
|
|
124
|
+
Float: import("@elaraai/east").FloatType;
|
|
125
|
+
String: StringType;
|
|
126
|
+
DateTime: import("@elaraai/east").DateTimeType;
|
|
127
|
+
Blob: import("@elaraai/east").BlobType;
|
|
128
|
+
}>>;
|
|
129
|
+
/**
|
|
130
|
+
* SQL query result row.
|
|
131
|
+
*
|
|
132
|
+
* Represents a single row from a query result as a dictionary mapping
|
|
133
|
+
* column names to typed values.
|
|
134
|
+
*/
|
|
135
|
+
export declare const SqlRowType: DictType<StringType, VariantType<{
|
|
136
|
+
Null: import("@elaraai/east").NullType;
|
|
137
|
+
Boolean: BooleanType;
|
|
138
|
+
Integer: IntegerType;
|
|
139
|
+
Float: import("@elaraai/east").FloatType;
|
|
140
|
+
String: StringType;
|
|
141
|
+
DateTime: import("@elaraai/east").DateTimeType;
|
|
142
|
+
Blob: import("@elaraai/east").BlobType;
|
|
143
|
+
}>>;
|
|
144
|
+
/**
|
|
145
|
+
* SQL query execution result.
|
|
146
|
+
*
|
|
147
|
+
* A variant type representing different query result types:
|
|
148
|
+
* - `select`: Results from SELECT queries with rows
|
|
149
|
+
* - `insert`: Results from INSERT with affected rows and optional last insert ID
|
|
150
|
+
* - `update`: Results from UPDATE with affected rows
|
|
151
|
+
* - `delete`: Results from DELETE with affected rows
|
|
152
|
+
*
|
|
153
|
+
* @remarks
|
|
154
|
+
* Using variants allows type-safe handling of different query types.
|
|
155
|
+
*/
|
|
156
|
+
export declare const SqlResultType: VariantType<{
|
|
157
|
+
/**
|
|
158
|
+
* SELECT query result with rows.
|
|
159
|
+
*/
|
|
160
|
+
select: StructType<{
|
|
161
|
+
/** Array of rows returned by the query */
|
|
162
|
+
rows: ArrayType<DictType<StringType, VariantType<{
|
|
163
|
+
Null: import("@elaraai/east").NullType;
|
|
164
|
+
Boolean: BooleanType;
|
|
165
|
+
Integer: IntegerType;
|
|
166
|
+
Float: import("@elaraai/east").FloatType;
|
|
167
|
+
String: StringType;
|
|
168
|
+
DateTime: import("@elaraai/east").DateTimeType;
|
|
169
|
+
Blob: import("@elaraai/east").BlobType;
|
|
170
|
+
}>>>;
|
|
171
|
+
}>;
|
|
172
|
+
/**
|
|
173
|
+
* INSERT query result with metadata.
|
|
174
|
+
*/
|
|
175
|
+
insert: StructType<{
|
|
176
|
+
/** Number of rows inserted */
|
|
177
|
+
rowsAffected: IntegerType;
|
|
178
|
+
/** Last inserted row ID (database-specific, may be None) */
|
|
179
|
+
lastInsertId: OptionType<IntegerType>;
|
|
180
|
+
}>;
|
|
181
|
+
/**
|
|
182
|
+
* UPDATE query result with metadata.
|
|
183
|
+
*/
|
|
184
|
+
update: StructType<{
|
|
185
|
+
/** Number of rows updated */
|
|
186
|
+
rowsAffected: IntegerType;
|
|
187
|
+
}>;
|
|
188
|
+
/**
|
|
189
|
+
* DELETE query result with metadata.
|
|
190
|
+
*/
|
|
191
|
+
delete: StructType<{
|
|
192
|
+
/** Number of rows deleted */
|
|
193
|
+
rowsAffected: IntegerType;
|
|
194
|
+
}>;
|
|
195
|
+
}>;
|
|
196
|
+
/**
|
|
197
|
+
* Opaque connection handle type.
|
|
198
|
+
*
|
|
199
|
+
* Represents an active database connection.
|
|
200
|
+
* Handles are created by connect() functions and used in query operations.
|
|
201
|
+
*
|
|
202
|
+
* @internal
|
|
203
|
+
*/
|
|
204
|
+
export declare const ConnectionHandleType: StringType;
|
|
205
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/sql/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;GAOG;AAEH,OAAO,EACH,UAAU,EACV,WAAW,EACX,UAAU,EACV,SAAS,EACT,QAAQ,EACR,UAAU,EACV,WAAW,EACX,WAAW,EACd,MAAM,eAAe,CAAC;AAIvB,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;IACzB;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;EAEL,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,kBAAkB;IAC3B,+CAA+C;;IAG/C,8CAA8C;;IAG9C,kCAAkC;;IAGlC,kCAAkC;;IAGlC,kCAAkC;;IAGlC;;;OAGG;;IAGH;;;OAGG;;EAEL,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,eAAe;IACxB,0CAA0C;;IAG1C,yCAAyC;;IAGzC,kCAAkC;;IAGlC,kCAAkC;;IAGlC,kCAAkC;;IAGlC;;;OAGG;;IAGH;;;OAGG;;EAEL,CAAC;AAEH;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;EAAmB,CAAC;AAEjD;;;;GAIG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;GAA8B,CAAC;AAE7D;;;;;GAKG;AACH,eAAO,MAAM,UAAU;;;;;;;;GAAyC,CAAC;AAEjE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa;IACtB;;OAEG;;QAEC,0CAA0C;;;;;;;;;;;IAI9C;;OAEG;;QAEC,8BAA8B;;QAE9B,4DAA4D;;;IAIhE;;OAEG;;QAEC,6BAA6B;;;IAIjC;;OAEG;;QAEC,6BAA6B;;;EAGnC,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,YAAa,CAAC"}
|
|
@@ -0,0 +1,175 @@
|
|
|
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
|
+
* Shared SQL type definitions for East Node IO.
|
|
7
|
+
*
|
|
8
|
+
* Provides East type definitions for SQL database operations including
|
|
9
|
+
* connection configurations, query parameters, and result types.
|
|
10
|
+
*
|
|
11
|
+
* @packageDocumentation
|
|
12
|
+
*/
|
|
13
|
+
import { StructType, VariantType, OptionType, ArrayType, DictType, StringType, IntegerType, BooleanType, } from "@elaraai/east";
|
|
14
|
+
import { LiteralValueType } from "@elaraai/east/internal";
|
|
15
|
+
// Re-export StringType for use in other SQL modules
|
|
16
|
+
export { StringType } from "@elaraai/east";
|
|
17
|
+
/**
|
|
18
|
+
* SQLite database connection configuration.
|
|
19
|
+
*
|
|
20
|
+
* Configures a connection to a SQLite database file or in-memory database.
|
|
21
|
+
*/
|
|
22
|
+
export const SqliteConfigType = StructType({
|
|
23
|
+
/**
|
|
24
|
+
* Path to the SQLite database file.
|
|
25
|
+
* Use ":memory:" for in-memory database.
|
|
26
|
+
*/
|
|
27
|
+
path: StringType,
|
|
28
|
+
/**
|
|
29
|
+
* Open database in read-only mode.
|
|
30
|
+
* Optional, defaults to false (read-write).
|
|
31
|
+
*/
|
|
32
|
+
readOnly: OptionType(BooleanType),
|
|
33
|
+
/**
|
|
34
|
+
* Use in-memory database.
|
|
35
|
+
* Optional, defaults to false.
|
|
36
|
+
*/
|
|
37
|
+
memory: OptionType(BooleanType),
|
|
38
|
+
});
|
|
39
|
+
/**
|
|
40
|
+
* PostgreSQL database connection configuration.
|
|
41
|
+
*
|
|
42
|
+
* Configures a connection pool to a PostgreSQL database server.
|
|
43
|
+
*/
|
|
44
|
+
export const PostgresConfigType = StructType({
|
|
45
|
+
/** PostgreSQL server hostname or IP address */
|
|
46
|
+
host: StringType,
|
|
47
|
+
/** PostgreSQL server port (typically 5432) */
|
|
48
|
+
port: IntegerType,
|
|
49
|
+
/** Database name to connect to */
|
|
50
|
+
database: StringType,
|
|
51
|
+
/** Username for authentication */
|
|
52
|
+
user: StringType,
|
|
53
|
+
/** Password for authentication */
|
|
54
|
+
password: StringType,
|
|
55
|
+
/**
|
|
56
|
+
* Enable SSL/TLS connection.
|
|
57
|
+
* Optional, defaults to false.
|
|
58
|
+
*/
|
|
59
|
+
ssl: OptionType(BooleanType),
|
|
60
|
+
/**
|
|
61
|
+
* Maximum number of connections in the pool.
|
|
62
|
+
* Optional, defaults to 10.
|
|
63
|
+
*/
|
|
64
|
+
maxConnections: OptionType(IntegerType),
|
|
65
|
+
});
|
|
66
|
+
/**
|
|
67
|
+
* MySQL database connection configuration.
|
|
68
|
+
*
|
|
69
|
+
* Configures a connection pool to a MySQL database server.
|
|
70
|
+
*/
|
|
71
|
+
export const MySqlConfigType = StructType({
|
|
72
|
+
/** MySQL server hostname or IP address */
|
|
73
|
+
host: StringType,
|
|
74
|
+
/** MySQL server port (typically 3306) */
|
|
75
|
+
port: IntegerType,
|
|
76
|
+
/** Database name to connect to */
|
|
77
|
+
database: StringType,
|
|
78
|
+
/** Username for authentication */
|
|
79
|
+
user: StringType,
|
|
80
|
+
/** Password for authentication */
|
|
81
|
+
password: StringType,
|
|
82
|
+
/**
|
|
83
|
+
* Enable SSL/TLS connection.
|
|
84
|
+
* Optional, defaults to false.
|
|
85
|
+
*/
|
|
86
|
+
ssl: OptionType(BooleanType),
|
|
87
|
+
/**
|
|
88
|
+
* Maximum number of connections in the pool.
|
|
89
|
+
* Optional, defaults to 10.
|
|
90
|
+
*/
|
|
91
|
+
maxConnections: OptionType(IntegerType),
|
|
92
|
+
});
|
|
93
|
+
/**
|
|
94
|
+
* SQL query parameter value type.
|
|
95
|
+
*
|
|
96
|
+
* Represents a typed value that can be used as a parameter in SQL queries.
|
|
97
|
+
* Supports all common SQL types with proper type safety.
|
|
98
|
+
*
|
|
99
|
+
* @remarks
|
|
100
|
+
* Use East.variant() to create parameter values:
|
|
101
|
+
* - `East.variant("string", "text")`
|
|
102
|
+
* - `East.variant("int", 42n)`
|
|
103
|
+
* - `East.variant("float", 3.14)`
|
|
104
|
+
* - `East.variant("bool", true)`
|
|
105
|
+
* - `East.variant("null", {})`
|
|
106
|
+
* - `East.variant("blob", new Uint8Array([1, 2, 3]))`
|
|
107
|
+
*/
|
|
108
|
+
export const SqlParameterType = LiteralValueType;
|
|
109
|
+
/**
|
|
110
|
+
* Array of SQL query parameters.
|
|
111
|
+
*
|
|
112
|
+
* Used to pass parameters to parameterized SQL queries.
|
|
113
|
+
*/
|
|
114
|
+
export const SqlParametersType = ArrayType(SqlParameterType);
|
|
115
|
+
/**
|
|
116
|
+
* SQL query result row.
|
|
117
|
+
*
|
|
118
|
+
* Represents a single row from a query result as a dictionary mapping
|
|
119
|
+
* column names to typed values.
|
|
120
|
+
*/
|
|
121
|
+
export const SqlRowType = DictType(StringType, SqlParameterType);
|
|
122
|
+
/**
|
|
123
|
+
* SQL query execution result.
|
|
124
|
+
*
|
|
125
|
+
* A variant type representing different query result types:
|
|
126
|
+
* - `select`: Results from SELECT queries with rows
|
|
127
|
+
* - `insert`: Results from INSERT with affected rows and optional last insert ID
|
|
128
|
+
* - `update`: Results from UPDATE with affected rows
|
|
129
|
+
* - `delete`: Results from DELETE with affected rows
|
|
130
|
+
*
|
|
131
|
+
* @remarks
|
|
132
|
+
* Using variants allows type-safe handling of different query types.
|
|
133
|
+
*/
|
|
134
|
+
export const SqlResultType = VariantType({
|
|
135
|
+
/**
|
|
136
|
+
* SELECT query result with rows.
|
|
137
|
+
*/
|
|
138
|
+
select: StructType({
|
|
139
|
+
/** Array of rows returned by the query */
|
|
140
|
+
rows: ArrayType(SqlRowType),
|
|
141
|
+
}),
|
|
142
|
+
/**
|
|
143
|
+
* INSERT query result with metadata.
|
|
144
|
+
*/
|
|
145
|
+
insert: StructType({
|
|
146
|
+
/** Number of rows inserted */
|
|
147
|
+
rowsAffected: IntegerType,
|
|
148
|
+
/** Last inserted row ID (database-specific, may be None) */
|
|
149
|
+
lastInsertId: OptionType(IntegerType),
|
|
150
|
+
}),
|
|
151
|
+
/**
|
|
152
|
+
* UPDATE query result with metadata.
|
|
153
|
+
*/
|
|
154
|
+
update: StructType({
|
|
155
|
+
/** Number of rows updated */
|
|
156
|
+
rowsAffected: IntegerType,
|
|
157
|
+
}),
|
|
158
|
+
/**
|
|
159
|
+
* DELETE query result with metadata.
|
|
160
|
+
*/
|
|
161
|
+
delete: StructType({
|
|
162
|
+
/** Number of rows deleted */
|
|
163
|
+
rowsAffected: IntegerType,
|
|
164
|
+
}),
|
|
165
|
+
});
|
|
166
|
+
/**
|
|
167
|
+
* Opaque connection handle type.
|
|
168
|
+
*
|
|
169
|
+
* Represents an active database connection.
|
|
170
|
+
* Handles are created by connect() functions and used in query operations.
|
|
171
|
+
*
|
|
172
|
+
* @internal
|
|
173
|
+
*/
|
|
174
|
+
export const ConnectionHandleType = StringType;
|
|
175
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/sql/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;GAOG;AAEH,OAAO,EACH,UAAU,EACV,WAAW,EACX,UAAU,EACV,SAAS,EACT,QAAQ,EACR,UAAU,EACV,WAAW,EACX,WAAW,GACd,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,oDAAoD;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,CAAC;IACvC;;;OAGG;IACH,IAAI,EAAE,UAAU;IAEhB;;;OAGG;IACH,QAAQ,EAAE,UAAU,CAAC,WAAW,CAAC;IAEjC;;;OAGG;IACH,MAAM,EAAE,UAAU,CAAC,WAAW,CAAC;CAClC,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,UAAU,CAAC;IACzC,+CAA+C;IAC/C,IAAI,EAAE,UAAU;IAEhB,8CAA8C;IAC9C,IAAI,EAAE,WAAW;IAEjB,kCAAkC;IAClC,QAAQ,EAAE,UAAU;IAEpB,kCAAkC;IAClC,IAAI,EAAE,UAAU;IAEhB,kCAAkC;IAClC,QAAQ,EAAE,UAAU;IAEpB;;;OAGG;IACH,GAAG,EAAE,UAAU,CAAC,WAAW,CAAC;IAE5B;;;OAGG;IACH,cAAc,EAAE,UAAU,CAAC,WAAW,CAAC;CAC1C,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAAC;IACtC,0CAA0C;IAC1C,IAAI,EAAE,UAAU;IAEhB,yCAAyC;IACzC,IAAI,EAAE,WAAW;IAEjB,kCAAkC;IAClC,QAAQ,EAAE,UAAU;IAEpB,kCAAkC;IAClC,IAAI,EAAE,UAAU;IAEhB,kCAAkC;IAClC,QAAQ,EAAE,UAAU;IAEpB;;;OAGG;IACH,GAAG,EAAE,UAAU,CAAC,WAAW,CAAC;IAE5B;;;OAGG;IACH,cAAc,EAAE,UAAU,CAAC,WAAW,CAAC;CAC1C,CAAC,CAAC;AAEH;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,gBAAgB,CAAC;AAEjD;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,SAAS,CAAC,gBAAgB,CAAC,CAAC;AAE7D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;AAEjE;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,WAAW,CAAC;IACrC;;OAEG;IACH,MAAM,EAAE,UAAU,CAAC;QACf,0CAA0C;QAC1C,IAAI,EAAE,SAAS,CAAC,UAAU,CAAC;KAC9B,CAAC;IAEF;;OAEG;IACH,MAAM,EAAE,UAAU,CAAC;QACf,8BAA8B;QAC9B,YAAY,EAAE,WAAW;QACzB,4DAA4D;QAC5D,YAAY,EAAE,UAAU,CAAC,WAAW,CAAC;KACxC,CAAC;IAEF;;OAEG;IACH,MAAM,EAAE,UAAU,CAAC;QACf,6BAA6B;QAC7B,YAAY,EAAE,WAAW;KAC5B,CAAC;IAEF;;OAEG;IACH,MAAM,EAAE,UAAU,CAAC;QACf,6BAA6B;QAC7B,YAAY,EAAE,WAAW;KAC5B,CAAC;CACL,CAAC,CAAC;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,UAAU,CAAC"}
|