@ttoss/lambda-postgres-query 0.2.1 → 0.2.3

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/README.md CHANGED
@@ -25,7 +25,11 @@ pnpm install @ttoss/lambda-postgres-query
25
25
  Create a `src/cloudformation.ts` file with the following content:
26
26
 
27
27
  ```typescript
28
- import { createLambdaQueryTemplate } from '@ttoss/lambda-postgres-query';
28
+ import { createLambdaQueryTemplate } from '@ttoss/lambda-postgres-query/cloudformation';
29
+
30
+ const template = createLambdaQueryTemplate();
31
+
32
+ export default template;
29
33
  ```
30
34
 
31
35
  Create a `src/handler.ts` file with the following content:
@@ -63,6 +67,8 @@ Add the `deploy` script to the `package.json` file:
63
67
  pnpm deploy
64
68
  ```
65
69
 
70
+ _**Note:** When deploying using carlin, you need to set `lambdaFormat: 'cjs'` because `pg` package doesn't support ESM format._
71
+
66
72
  It'll create the necessary resources to query the Postgres database and display the name of the Lambda function created.
67
73
 
68
74
  ### Querying the database
@@ -1,4 +1,5 @@
1
1
  import { CloudFormationTemplate } from '@ttoss/cloudformation';
2
+ export { CloudFormationTemplate } from '@ttoss/cloudformation';
2
3
  import { Handler } from 'aws-lambda';
3
4
  import { QueryParams } from '../index.cjs';
4
5
  import 'pg';
@@ -1,4 +1,5 @@
1
1
  import { CloudFormationTemplate } from '@ttoss/cloudformation';
2
+ export { CloudFormationTemplate } from '@ttoss/cloudformation';
2
3
  import { Handler } from 'aws-lambda';
3
4
  import { QueryParams } from '../index.js';
4
5
  import 'pg';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttoss/lambda-postgres-query",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "Create a Lambda function that queries a PostgreSQL database.",
5
5
  "author": "ttoss",
6
6
  "contributors": [
@@ -19,9 +19,9 @@
19
19
  "types": "./dist/index.d.ts"
20
20
  },
21
21
  "./cloudformation": {
22
- "import": "./dist/esm/cloudformation.js",
23
- "require": "./dist/cloudformation.js",
24
- "types": "./dist/cloudformation.d.ts"
22
+ "import": "./dist/esm/cloudformation/index.js",
23
+ "require": "./dist/cloudformation/index.js",
24
+ "types": "./dist/cloudformation/index.d.ts"
25
25
  }
26
26
  },
27
27
  "files": [
@@ -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/config": "^1.32.6",
42
- "@ttoss/test-utils": "^2.1.10"
41
+ "@ttoss/test-utils": "^2.1.10",
42
+ "@ttoss/config": "^1.32.6"
43
43
  },
44
44
  "keywords": [
45
45
  "aws",
@@ -1,5 +1,7 @@
1
1
  import type { CloudFormationTemplate } from '@ttoss/cloudformation';
2
2
 
3
+ export type { CloudFormationTemplate };
4
+
3
5
  export const HANDLER_DEFAULT = 'handler.handler';
4
6
 
5
7
  export const MEMORY_SIZE_DEFAULT = 128;