https://github.com/makerxstudio/typeorm-pg-toolkit
MakerX TypeORM Postgres toolkit
https://github.com/makerxstudio/typeorm-pg-toolkit
Last synced: about 1 year ago
JSON representation
MakerX TypeORM Postgres toolkit
- Host: GitHub
- URL: https://github.com/makerxstudio/typeorm-pg-toolkit
- Owner: MakerXStudio
- License: mit
- Created: 2023-10-24T03:57:53.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-29T03:52:35.000Z (over 2 years ago)
- Last Synced: 2024-10-30T03:06:40.563Z (over 1 year ago)
- Language: JavaScript
- Size: 220 KB
- Stars: 0
- Watchers: 10
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TypeORM toolkit
## Install
```
npm install @makerx/typeorm-pg-toolkit --save-dev
```
A set of useful TypeORM tools to work with Postgres
## Features
Supported features are:
### Data migrations
- `migration-create`: Create an empty migration script.
- `migration-generate`: Generate migration scripts to match the current Postgres database with the current entity model.
- `migration-check`: Check for discrepancies between the current Postgres database and the current entity model.
- `migration-revert`: Revert the latest migration script.
### Data snapshot
- `snapshot-create`: Create a snapshot of the current Postgres database.
- `snapshot-restore`: Restore a snapshot
- `snapshot-clean`: Delete all snapshots
## Environment variables
This toolkit expect you to set the below environment variables
### Data migrations
- `TYPEORM_TOOLKIT_MIGRATION_DATASOURCE_CONFIG`: The path to TypeORM datasource file.
- `TYPEORM_TOOLKIT_MIGRATION_ROOT_DIR`: The directory to generate new migration scripts to.
### Data snapshots
- `TYPEORM_TOOLKIT_DATABASE_HOST`: Postgres database host
- `TYPEORM_TOOLKIT_DATABASE_PORT`: Postgres database port
- `TYPEORM_TOOLKIT_DATABASE_NAME`: Postgres database name
- `TYPEORM_TOOLKIT_DATABASE_USERNAME`: Postgres database username
- `TYPEORM_TOOLKIT_DATABASE_PASSWORD`: Postgres database password
Note: The username must have permissions to create snapshot/restore permissions.