@brainsecode/plugin-db-postgres
v1.3.0
Published
Use a PostgreSQL database in a service generated by Brainsecode
Downloads
2
Readme
@brainsecode/plugin-db-postgres
Use a PostgreSQL database in the service generated by Brainsecode.
Note: this plugin is used by the code generation engine by default when no other DB plugin is installed.
Purpose
This plugin adds the required code to use PostgreSQL database in the service generated by Brainsecode. It updates the following parts:
- Updates the datasource on the
schema.prisma
file - Adds the requires services and variables to
docker-compose.yml
- Replaces the
docker-compose-db.yml
- Add the requires environment variables to
.env
Configuration
The plugin uses the parameters configured on the database tab on the service settings page
Usage
This plugin integrates with the all default tasks and scripts used by the generated service:
"seed": "ts-node scripts/seed.ts",
"db:migrate-save": "prisma migrate dev",
"db:migrate-up": "prisma migrate deploy",
"db:clean": "ts-node scripts/clean.ts",
"db:init": "run-s \"db:migrate-save -- --name 'initial version'\" db:migrate-up seed",
"prisma:generate": "prisma generate",
"docker:db": "docker-compose -f docker-compose.db.yml up -d",
"docker:build": "docker build .",
"compose:up": "docker-compose up -d",
"compose:down": "docker-compose down --volumes"