Registry / devops / resolve-snapshot-postgresql-serverless

resolve-snapshot-postgresql-serverless

JSON →
library0.23.2jsnpmunverified

Adapter for storing event-sourced snapshots in AWS Aurora Serverless PostgreSQL 10.7. Version 0.23.2 is stable with monthly releases. Requires peer dependency on aws-sdk and Node >=10.9. Alternative to in-memory or DynamoDB snapshot stores within the reSolve CQRS framework.

npm install resolve-snapshot-postgresql-serverless
INSTALL
IMPORT
SIG · RESOLVE-SNAPSHOT-P
R
resolve-snapshot-postgresql-serverless
devopsjavascriptv0.23.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

createSnapshotAdapter
✓ import createSnapshotAdapter from 'resolve-snapshot-postgres-serverless'
✗ const createSnapshotAdapter = require('resolve-snapshot-postgres-serverless')
Package uses default export; CommonJS require is supported for Node >=10.9 but ESM is preferred.
SnapshotAdapterType
✓ import createSnapshotAdapter from 'resolve-snapshot-postgres-serverless'
No TypeScript types shipped; define your own or use JSDoc.
none (entire module as namespace)
✓ import * as snapshot from 'resolve-snapshot-postgres-serverless'
✗ const snapshot = require('resolve-snapshot-postgres-serverless')
Namespace import works for ESM; avoid mixing default and namespace imports.

Demonstrates creating a snapshot adapter for Aurora Serverless PostgreSQL, saving, loading, dropping a snapshot, and disposing.

import createSnapshotAdapter from 'resolve-snapshot-postgres-serverless'; const snapshotAdapter = createSnapshotAdapter({ awsSecretStoreArn: process.env.AWS_SECRET_STORE_ARN ?? '', dbClusterOrInstanceArn: process.env.DB_CLUSTER_ARN ?? '', databaseName: process.env.DATABASE_NAME ?? 'snapshots', tableName: process.env.TABLE_NAME ?? 'snapshots', region: process.env.AWS_REGION ?? 'us-east-1', bucketSize: 100 }); async function main() { const key = 'snapshot:aggregateId:123'; await snapshotAdapter.saveSnapshot(key, { data: { version: 1 } }); const snapshot = await snapshotAdapter.loadSnapshot(key); console.log(snapshot); await snapshotAdapter.drop(key); await snapshotAdapter.dispose(); } main().catch(console.error);
Debug
Known issues
breakingVersion 0.x API may change without major version bump; pin exact version in package.json.
fix
Use exact version or ^0.23.2 instead of ^0.0.0
affects: >=0.0.0
deprecatedThe 'aws-sdk' peer dependency is v2; AWS SDK v3 is not supported. Consider using v2 or fork for v3.
fix
Install aws-sdk@2.x: npm install aws-sdk@^2
affects: >=0.0.0
gotchaRequires AWS RDS Data API enabled on the Aurora cluster; otherwise connections fail.
fix
Enable Data API when creating the Aurora Serverless cluster.
affects: >=0.0.0
gotchaThe 'bucketSize' parameter affects performance; misconfiguration can lead to slow snapshot retrieval.
fix
Set bucketSize based on expected snapshot count (typical range 10-1000).
affects: >=0.0.0
gotchaDatabase table must exist; adapter does not auto-create it.
fix
Manually create table with schema: (id text PRIMARY KEY, snapshot jsonb, timestamp bigint)
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'resolve-snapshot-postgres-serverless'
Package not installed or not in node_modules.
fix
Run: npm install resolve-snapshot-postgres-serverless
TypeError: createSnapshotAdapter is not a function
Incorrect import: using require instead of default import.
fix
Use: import createSnapshotAdapter from 'resolve-snapshot-postgres-serverless'
MissingRequiredParameter: Missing required key 'awsSecretStoreArn' in params
Required parameter not provided to createSnapshotAdapter.
fix
Ensure all required parameters are passed: awsSecretStoreArn, dbClusterOrInstanceArn, databaseName, region.
AccessDeniedException: User: arn:aws:iam::... is not authorized to perform: rds-data:ExecuteStatement
IAM role or user lacks permissions for RDS Data API.
fix
Attach policy AWSLambdaVPCAccessExecutionRole or custom policy with rds-data:ExecuteStatement.
Upgrade
Version history
0.23.2latest on npm
Audit
Dependencies
aws-sdkrequiredUsed to communicate with AWS RDS Data Service (Secrets Manager, RDS)
Agent activity
4 hits · last 30 days
node
4
Resources
resolve-snapshot-postgresql-serverless — npm install resolve-snapshot-postgresql-serverless · libregistry