@or-sdk/pgsql 1.4.4-beta.4126.0 → 1.4.4
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/CHANGELOG.md +9 -0
- package/dist/types/Pgsql.d.ts +189 -0
- package/dist/types/Pgsql.d.ts.map +1 -1
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,15 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.4.4](https://gitlab.internal.onereach.io/onereach/platform/or-sdk-next/compare/@or-sdk/pgsql@1.4.3...@or-sdk/pgsql@1.4.4) (2026-05-05)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **pgsql:** use parameterized insert queries ([888d807](https://gitlab.internal.onereach.io/onereach/platform/or-sdk-next/commit/888d8072fb226f24202f0196e0b2e312b8a5ab03))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
6
15
|
## [1.4.3](https://gitlab.internal.onereach.io/onereach/platform/or-sdk-next/compare/@or-sdk/pgsql@1.4.2...@or-sdk/pgsql@1.4.3) (2026-04-30)
|
|
7
16
|
|
|
8
17
|
**Note:** Version bump only for package @or-sdk/pgsql
|
package/dist/types/Pgsql.d.ts
CHANGED
|
@@ -5,52 +5,241 @@ export declare class Pgsql extends Base {
|
|
|
5
5
|
private timeoutMs?;
|
|
6
6
|
private transaction?;
|
|
7
7
|
constructor(params: PgsqlConfig);
|
|
8
|
+
/**
|
|
9
|
+
* Make request
|
|
10
|
+
* ```typescript
|
|
11
|
+
* const result = await dataHubSvc.makeRequest({
|
|
12
|
+
* route: '/route',
|
|
13
|
+
* method: 'GET',
|
|
14
|
+
* data: requestData,
|
|
15
|
+
* params: queryParams,
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
8
19
|
makeRequest<T>(params: CalApiParams): Promise<T>;
|
|
9
20
|
makeApiUrl(data: MakeApiUrlData): string;
|
|
21
|
+
/**
|
|
22
|
+
* Execute query
|
|
23
|
+
* ```typescript
|
|
24
|
+
* const result = await pgsql.executeQuery({
|
|
25
|
+
* query: 'select * from table',
|
|
26
|
+
* database: 'db-name'
|
|
27
|
+
* });
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
10
30
|
executeQuery<T>({ query, params, database }: ExecuteQueryArgs): Promise<ExecuteQueryResponse<T>>;
|
|
31
|
+
/**
|
|
32
|
+
* List databases
|
|
33
|
+
* ```typescript
|
|
34
|
+
* const databaseList = await pgsql.listDatabases();
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
11
37
|
listDatabases(): Promise<List<DatabaseItem>>;
|
|
38
|
+
/**
|
|
39
|
+
* Create database
|
|
40
|
+
* ```typescript
|
|
41
|
+
* const result = await pgsql.createDatabase({ database: 'db-name' });
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
12
44
|
createDatabase({ database, externalCredentials, }: CreateDatabaseParams): Promise<CreateDatabaseResponse>;
|
|
45
|
+
/**
|
|
46
|
+
* Get database info
|
|
47
|
+
*
|
|
48
|
+
* @deprecated route not available
|
|
49
|
+
* ```typescript
|
|
50
|
+
* const result = await pgsql.getDatabaseInfo({ database: 'db-name' });
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
/**
|
|
54
|
+
* Drop database
|
|
55
|
+
* ```typescript
|
|
56
|
+
* const result = await pgsql.dropDatabase({ database: 'db-name' });
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
13
59
|
dropDatabase({ database, isExternal, }: {
|
|
14
60
|
database: string;
|
|
15
61
|
isExternal?: boolean;
|
|
16
62
|
}): Promise<DropDatabaseResponse>;
|
|
63
|
+
/**
|
|
64
|
+
* List tables
|
|
65
|
+
* ```typescript
|
|
66
|
+
* const result = await pgsql.listTables({ database: 'db-name', schema: 'schema-name' });
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
17
69
|
listTables({ database, schema, }: {
|
|
18
70
|
database: string;
|
|
19
71
|
schema?: string;
|
|
20
72
|
}): Promise<List<string>>;
|
|
73
|
+
/**
|
|
74
|
+
* List schemas
|
|
75
|
+
* ```typescript
|
|
76
|
+
* const result = await pgsql.listSchemas({ database: 'db-name' });
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
21
79
|
listSchemas({ database }: {
|
|
22
80
|
database: string;
|
|
23
81
|
}): Promise<List<string>>;
|
|
82
|
+
/**
|
|
83
|
+
* Create schema
|
|
84
|
+
* ```typescript
|
|
85
|
+
* const result = await pgsql.createSchema({ database: 'db-name', schema: 'schema-name' });
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
24
88
|
createSchema({ database, schema, }: {
|
|
25
89
|
database: string;
|
|
26
90
|
schema: string;
|
|
27
91
|
}): Promise<ExecuteQueryResponse<void>>;
|
|
92
|
+
/**
|
|
93
|
+
* Drop schema
|
|
94
|
+
* ```typescript
|
|
95
|
+
* const result = await pgsql.dropSchema({ database: 'db-name', schema: 'schema-name' });
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
28
98
|
dropSchema({ database, schema, }: {
|
|
29
99
|
database: string;
|
|
30
100
|
schema: string;
|
|
31
101
|
}): Promise<ExecuteQueryResponse<void>>;
|
|
102
|
+
/**
|
|
103
|
+
* Drop table
|
|
104
|
+
* ```typescript
|
|
105
|
+
* const result = await pgsql.dropSchema({ database: 'db-name', schema: 'schema-name', table: 'table-name' });
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
32
108
|
dropTable({ database, schema, table, }: {
|
|
33
109
|
database: string;
|
|
34
110
|
schema: string;
|
|
35
111
|
table: string;
|
|
36
112
|
}): Promise<ExecuteQueryResponse<void>>;
|
|
113
|
+
/**
|
|
114
|
+
* Create table
|
|
115
|
+
* ```typescript
|
|
116
|
+
* const result = await pgsql.createTable({
|
|
117
|
+
* database: 'db-name',
|
|
118
|
+
* schema: 'schema-name',
|
|
119
|
+
* table: 'table-name',
|
|
120
|
+
* columns: [
|
|
121
|
+
* { name: 'col1', type: 'integer' },
|
|
122
|
+
* { name: 'col2', type: 'text' }
|
|
123
|
+
* ],
|
|
124
|
+
* primaryKey: 'col1,col2'
|
|
125
|
+
* });
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
37
128
|
createTable({ database, schema, table, columns, primaryKey, }: CreateTableArgs): Promise<ExecuteQueryResponse<void>>;
|
|
129
|
+
/**
|
|
130
|
+
* Drop database
|
|
131
|
+
* ```typescript
|
|
132
|
+
* const result = await pgsql.addColumns({
|
|
133
|
+
* database: 'db-name',
|
|
134
|
+
* schema: 'schema-name',
|
|
135
|
+
* table: 'table-name',
|
|
136
|
+
* columns: [
|
|
137
|
+
* { name: 'col1', type: 'integer' },
|
|
138
|
+
* { name: 'col2', type: 'text' }
|
|
139
|
+
* ],
|
|
140
|
+
* });
|
|
141
|
+
* ```
|
|
142
|
+
*/
|
|
38
143
|
addColumns({ database, schema, table, columns }: AddColumnsArgs): Promise<ExecuteQueryResponse<void>>;
|
|
144
|
+
/**
|
|
145
|
+
* Insert
|
|
146
|
+
* ```typescript
|
|
147
|
+
* const result = await pgsql.insert({
|
|
148
|
+
* database: 'db-name',
|
|
149
|
+
* schema: 'schema-name',
|
|
150
|
+
* table: 'table-name',
|
|
151
|
+
* rows: [
|
|
152
|
+
* { col1: 'value' }
|
|
153
|
+
* ],
|
|
154
|
+
* chunkSize: 300,
|
|
155
|
+
* context: { progress: 0 } // progress of insert will be set from 0 to 100
|
|
156
|
+
* });
|
|
157
|
+
* ```
|
|
158
|
+
*/
|
|
39
159
|
insert({ database, schema, table, rows, chunkSize, context, }: InsertArgs): Promise<ExecuteQueryResponse<void>[]>;
|
|
160
|
+
/**
|
|
161
|
+
* Select all
|
|
162
|
+
* ```typescript
|
|
163
|
+
* const result = await pgsql.selectAll({
|
|
164
|
+
* database: 'db-name',
|
|
165
|
+
* query: 'select * from table', // must be select only, without limit and offset
|
|
166
|
+
* chunkSize: 300,
|
|
167
|
+
* offset: 0,
|
|
168
|
+
* limit: 0,
|
|
169
|
+
* context: { progress: 0, total: 0 } // progress of select will be set from 0 to 100
|
|
170
|
+
* });
|
|
171
|
+
* ```
|
|
172
|
+
*/
|
|
40
173
|
selectAll({ database, query, context, chunkSize, offset, limit, }: SelectAllArgs): Promise<List<Row>>;
|
|
174
|
+
/**
|
|
175
|
+
* Get primary keys
|
|
176
|
+
* ```typescript
|
|
177
|
+
* const result = await pgsql.getPrimaryKeys({ database: 'db-name', schema: 'schema-name', table: 'table-name' });
|
|
178
|
+
* ```
|
|
179
|
+
*/
|
|
41
180
|
getPrimaryKeys({ database, schema, table, }: {
|
|
42
181
|
database: string;
|
|
43
182
|
schema: string;
|
|
44
183
|
table: string;
|
|
45
184
|
}): Promise<string>;
|
|
185
|
+
/**
|
|
186
|
+
* Edit row
|
|
187
|
+
* ```typescript
|
|
188
|
+
* const result = await pgsql.editRow({
|
|
189
|
+
* database: 'db-name',
|
|
190
|
+
* schema: 'schema-name',
|
|
191
|
+
* table: 'table-name',
|
|
192
|
+
* key: 'col1',
|
|
193
|
+
* value: 'new_value',
|
|
194
|
+
* row: { pk: 'pk_val', col1: 'old_value' },
|
|
195
|
+
* primaryKeys: 'pk',
|
|
196
|
+
* });
|
|
197
|
+
* ```
|
|
198
|
+
*/
|
|
46
199
|
editRow({ database, schema, table, key, value, row, primaryKeys, }: EditRowArgs): Promise<ExecuteQueryResponse<void>>;
|
|
200
|
+
/**
|
|
201
|
+
* Delete rows
|
|
202
|
+
* ```typescript
|
|
203
|
+
* const result = await pgsql.deleteRows({
|
|
204
|
+
* database: 'db-name',
|
|
205
|
+
* schema: 'schema-name',
|
|
206
|
+
* table: 'table-name',
|
|
207
|
+
* rows: [
|
|
208
|
+
* { pk: 'pk_val', col1: 'value' }
|
|
209
|
+
* ],
|
|
210
|
+
* primaryKeys: 'pk',
|
|
211
|
+
* });
|
|
212
|
+
* ```
|
|
213
|
+
*/
|
|
47
214
|
deleteRows({ database, schema, table, rows, primaryKeys, }: DeleteRowsArgs): Promise<ExecuteQueryResponse<void>>;
|
|
215
|
+
/**
|
|
216
|
+
* Generate create table query for existing table
|
|
217
|
+
* ```typescript
|
|
218
|
+
* const result = await pgsql.generateTableSchema({
|
|
219
|
+
* database: 'db-name',
|
|
220
|
+
* schema: 'schema-name',
|
|
221
|
+
* table: 'table-name'
|
|
222
|
+
* });
|
|
223
|
+
* ```
|
|
224
|
+
*/
|
|
48
225
|
generateTableSchema({ database, schema, table, }: {
|
|
49
226
|
database: string;
|
|
50
227
|
schema: string;
|
|
51
228
|
table: string;
|
|
52
229
|
}): Promise<string>;
|
|
230
|
+
/**
|
|
231
|
+
* Get database size
|
|
232
|
+
* ```typescript
|
|
233
|
+
* const result = await pgsql.getDBSize();
|
|
234
|
+
* ```
|
|
235
|
+
*/
|
|
53
236
|
getDBSize(): Promise<GetDBSizeResult>;
|
|
237
|
+
/**
|
|
238
|
+
* Generate database definition
|
|
239
|
+
* ```typescript
|
|
240
|
+
* const result = pgsql.generateDbDefinition('databaseName');
|
|
241
|
+
* ```
|
|
242
|
+
*/
|
|
54
243
|
generateDbDefinition(database: string): Promise<string>;
|
|
55
244
|
}
|
|
56
245
|
//# sourceMappingURL=Pgsql.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pgsql.d.ts","sourceRoot":"","sources":["../../src/Pgsql.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAY,MAAM,cAAc,CAAC;AAGlF,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,sBAAsB,EAAE,eAAe,EACvC,YAAY,EACZ,cAAc,EAAE,oBAAoB,EAAE,WAAW,EACjD,gBAAgB,EAAE,oBAAoB,EAAE,eAAe,EAAE,UAAU,EAEnE,WAAW,EAAE,GAAG,EAAE,aAAa,EAChC,MAAM,SAAS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EACR,MAAM,EACN,KAAK,GACN,EAAE;QACD,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;KACf,GAAG,OAAO,CAAC,MAAM,CAAC;IASnB;;;;;OAKG;IACU,SAAS,IAAI,OAAO,CAAC,eAAe,CAAC;IAOlD;;;;;OAKG;IACU,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAOrE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@or-sdk/pgsql",
|
|
3
|
-
"version": "1.4.4
|
|
3
|
+
"version": "1.4.4",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -26,5 +26,6 @@
|
|
|
26
26
|
},
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"access": "public"
|
|
29
|
-
}
|
|
29
|
+
},
|
|
30
|
+
"gitHead": "ce8dd5430ed3986483c3361b8d0afa6a56af8474"
|
|
30
31
|
}
|