@ttoss/lambda-postgres-query 0.2.4 → 0.2.5
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/esm/index.js +4 -7
- package/dist/index.js +4 -7
- package/package.json +3 -3
- package/src/query.ts +10 -10
package/dist/esm/index.js
CHANGED
|
@@ -7,15 +7,12 @@ var asciiDecoder = new TextDecoder("ascii");
|
|
|
7
7
|
var query = async params => {
|
|
8
8
|
try {
|
|
9
9
|
const {
|
|
10
|
-
readOnly,
|
|
11
|
-
|
|
10
|
+
readOnly = true,
|
|
11
|
+
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
|
12
|
+
lambdaPostgresQueryFunction = process.env.LAMBDA_POSTGRES_QUERY_FUNCTION,
|
|
12
13
|
...pgParams
|
|
13
14
|
} = typeof params === "string" ? {
|
|
14
|
-
text: params
|
|
15
|
-
readOnly: true,
|
|
16
|
-
lambdaPostgresQueryFunction:
|
|
17
|
-
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
|
18
|
-
process.env.LAMBDA_POSTGRES_QUERY_FUNCTION
|
|
15
|
+
text: params
|
|
19
16
|
} : params;
|
|
20
17
|
const input = {
|
|
21
18
|
FunctionName: lambdaPostgresQueryFunction,
|
package/dist/index.js
CHANGED
|
@@ -38,15 +38,12 @@ var asciiDecoder = new TextDecoder("ascii");
|
|
|
38
38
|
var query = async params => {
|
|
39
39
|
try {
|
|
40
40
|
const {
|
|
41
|
-
readOnly,
|
|
42
|
-
|
|
41
|
+
readOnly = true,
|
|
42
|
+
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
|
43
|
+
lambdaPostgresQueryFunction = process.env.LAMBDA_POSTGRES_QUERY_FUNCTION,
|
|
43
44
|
...pgParams
|
|
44
45
|
} = typeof params === "string" ? {
|
|
45
|
-
text: params
|
|
46
|
-
readOnly: true,
|
|
47
|
-
lambdaPostgresQueryFunction:
|
|
48
|
-
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
|
49
|
-
process.env.LAMBDA_POSTGRES_QUERY_FUNCTION
|
|
46
|
+
text: params
|
|
50
47
|
} : params;
|
|
51
48
|
const input = {
|
|
52
49
|
FunctionName: lambdaPostgresQueryFunction,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/lambda-postgres-query",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "Create a Lambda function that queries a PostgreSQL database.",
|
|
5
5
|
"author": "ttoss",
|
|
6
6
|
"contributors": [
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"@types/pg": "^8.11.6",
|
|
39
39
|
"jest": "^29.7.0",
|
|
40
40
|
"tsup": "^8.1.0",
|
|
41
|
-
"@ttoss/
|
|
42
|
-
"@ttoss/
|
|
41
|
+
"@ttoss/config": "^1.32.6",
|
|
42
|
+
"@ttoss/test-utils": "^2.1.10"
|
|
43
43
|
},
|
|
44
44
|
"keywords": [
|
|
45
45
|
"aws",
|
package/src/query.ts
CHANGED
|
@@ -25,16 +25,16 @@ export const query = async <Rows extends QueryResultRow = any>(
|
|
|
25
25
|
params: QueryParams | string
|
|
26
26
|
) => {
|
|
27
27
|
try {
|
|
28
|
-
const {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
28
|
+
const {
|
|
29
|
+
readOnly = true,
|
|
30
|
+
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
|
31
|
+
lambdaPostgresQueryFunction = process.env.LAMBDA_POSTGRES_QUERY_FUNCTION,
|
|
32
|
+
...pgParams
|
|
33
|
+
} = typeof params === 'string'
|
|
34
|
+
? {
|
|
35
|
+
text: params,
|
|
36
|
+
}
|
|
37
|
+
: params;
|
|
38
38
|
|
|
39
39
|
const input: InvokeCommandInput = {
|
|
40
40
|
FunctionName: lambdaPostgresQueryFunction,
|