triangle-utils 1.4.128 → 1.4.129
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/src/UtilsRDS.d.ts +26 -10
- package/dist/src/UtilsRDS.js +2 -2
- package/package.json +1 -1
- package/src/UtilsRDS.ts +2 -2
package/dist/src/UtilsRDS.d.ts
CHANGED
|
@@ -10,32 +10,48 @@ export declare class UtilsRDS {
|
|
|
10
10
|
disconnect(): Promise<void>;
|
|
11
11
|
query(sql: string, options?: {
|
|
12
12
|
is_verbose?: boolean;
|
|
13
|
-
}): Promise<any
|
|
13
|
+
}): Promise<import("pg").QueryResult<any>>;
|
|
14
14
|
exec(sql: string, options?: {
|
|
15
15
|
is_verbose?: boolean;
|
|
16
|
-
}): Promise<
|
|
16
|
+
}): Promise<{
|
|
17
|
+
[k: string]: unknown;
|
|
18
|
+
}[]>;
|
|
17
19
|
get(table_id: string, primary_key: Record<string, any>, attribute_names?: string[], options?: {
|
|
18
20
|
is_verbose?: boolean;
|
|
19
|
-
}): Promise<Record<string, any
|
|
21
|
+
}): Promise<Record<string, any>>;
|
|
20
22
|
batch_get(table_id: string, primary_key: Record<string, any[]>, attribute_names?: string[], options?: {
|
|
21
23
|
is_verbose?: boolean;
|
|
22
|
-
}): Promise<
|
|
24
|
+
}): Promise<{
|
|
25
|
+
[k: string]: unknown;
|
|
26
|
+
}[]>;
|
|
23
27
|
create(table_id: string, item: Record<string, any>, options?: {
|
|
24
28
|
is_verbose?: boolean;
|
|
25
|
-
}): Promise<
|
|
29
|
+
}): Promise<{
|
|
30
|
+
[k: string]: unknown;
|
|
31
|
+
}[] | undefined>;
|
|
26
32
|
batch_create(table_id: string, items: Record<string, any>[], options?: {
|
|
27
33
|
is_verbose?: boolean;
|
|
28
|
-
}): Promise<
|
|
34
|
+
}): Promise<{
|
|
35
|
+
[k: string]: unknown;
|
|
36
|
+
}[] | undefined>;
|
|
29
37
|
put(table_id: string, item: Record<string, any>, options?: {
|
|
30
38
|
is_verbose?: boolean;
|
|
31
|
-
}): Promise<
|
|
39
|
+
}): Promise<{
|
|
40
|
+
[k: string]: unknown;
|
|
41
|
+
}[] | undefined>;
|
|
32
42
|
batch_put(table_id: string, items: Record<string, any>[], options?: {
|
|
33
43
|
is_verbose?: boolean;
|
|
34
|
-
}): Promise<
|
|
44
|
+
}): Promise<{
|
|
45
|
+
[k: string]: unknown;
|
|
46
|
+
}[] | undefined>;
|
|
35
47
|
delete(table_id: string, primary_key: Record<string, any>, options?: {
|
|
36
48
|
is_verbose?: boolean;
|
|
37
|
-
}): Promise<
|
|
49
|
+
}): Promise<{
|
|
50
|
+
[k: string]: unknown;
|
|
51
|
+
}[]>;
|
|
38
52
|
batch_delete(table_id: string, primary_key: Record<string, any[]>, options?: {
|
|
39
53
|
is_verbose?: boolean;
|
|
40
|
-
}): Promise<
|
|
54
|
+
}): Promise<{
|
|
55
|
+
[k: string]: unknown;
|
|
56
|
+
}[]>;
|
|
41
57
|
}
|
package/dist/src/UtilsRDS.js
CHANGED
|
@@ -63,7 +63,7 @@ export class UtilsRDS {
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
const response = await this.postgres.query(sql);
|
|
66
|
-
return response
|
|
66
|
+
return response;
|
|
67
67
|
}
|
|
68
68
|
async exec(sql, options = {}) {
|
|
69
69
|
const is_verbose = Boolean(options.is_verbose);
|
|
@@ -87,7 +87,7 @@ export class UtilsRDS {
|
|
|
87
87
|
}
|
|
88
88
|
return [];
|
|
89
89
|
}
|
|
90
|
-
return items;
|
|
90
|
+
return items.map(item => Object.fromEntries(Object.entries(item).filter(([key, value]) => value !== null)));
|
|
91
91
|
}
|
|
92
92
|
async get(table_id, primary_key, attribute_names, options = {}) {
|
|
93
93
|
const sql = "SELECT " + (attribute_names === undefined ? "*" : attribute_names.join(", ")) + " FROM " + table_id + " WHERE " + Object.entries(primary_key).map(([key_name, value]) => key_name + " = " + convert_rds_input(value)).join(" AND ");
|
package/package.json
CHANGED
package/src/UtilsRDS.ts
CHANGED
|
@@ -78,7 +78,7 @@ export class UtilsRDS {
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
const response = await this.postgres.query(sql)
|
|
81
|
-
return response
|
|
81
|
+
return response
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
async exec(
|
|
@@ -108,7 +108,7 @@ export class UtilsRDS {
|
|
|
108
108
|
}
|
|
109
109
|
return []
|
|
110
110
|
}
|
|
111
|
-
return items
|
|
111
|
+
return items.map(item => Object.fromEntries(Object.entries(item).filter(([key, value]) => value !== null)))
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
async get(
|