VoltAgent PostgreSQL - PostgreSQL Memory provider integration for VoltAgent
npm install @voltagent/postgresThis package now includes integration tests that run against a real PostgreSQL database using Docker.
- Docker and Docker Compose installed
- Port 5433 available (used by test database)
``bash`
npm test
Runs unit tests with mocked database using vitest.
`bash`
npm run test:integration
This will:
1. Start a PostgreSQL container using Docker Compose
2. Run integration tests against the real database
3. Clean up the container when done
For development or debugging:
`bashStart test database
npm run test:integration:setup
- Real database operations (create, read, update, delete)
- SQL query validation and safety checks
- Error handling with actual database errors
- Storage limits enforcement
- User-scoped operations
- Transaction behavior
The integration tests use:
- Host: localhost
- Port: 5433
- Database: voltagent_test
- User: test
- Password: test
- Table Prefix: test_voltagent
The PostgreSQL storage now includes basic SQL validation to catch:
- Empty or invalid queries
- Dangerous SQL injection patterns
- Table prefix usage warnings
This validation is tested in both unit and integration tests.