@jujulego/nx-typeorm-plugin v1.0.0-alpha.7
nx-typeorm-plugin
Plugin for Nx mono-repositories. Helps to use Typeorm inside an app.
Setup
Before using this plugin you must setup Typeorm with an ormconfig.json
file at the root of your app.
All you need to use this plugin is to install it:
npm install --save-dev @jujulego/nx-typeorm-plugin
yarn add --dev @jujulego/nx-typeorm-plugin
Generators
migration
It will generate a new migration.
Use: nx g @jujulego/nx-typeorm-plugin:migration
Options
name | default | description |
---|---|---|
name | required | Name of the migration to generate |
project | nx default project | Nx project where the migration should be generated |
database | default | Database connection to use (as in the ormconfig.json ) |
Executors
db-create
It will create the database inside your database server.
Add the target db-create to your project's config in your workspace.json
:
{
"projects": {
"example": {
"targets": {
"db-create": {
"executor": "@jujulego/nx-typeorm-plugin:db-create"
}
}
}
}
}
Warning only postgresql
and mysql
databases are supported.
Options
name | default | description |
---|---|---|
database | default | Database connection to use (as in the ormconfig.json ) |
db-migrate
It will apply typeorm migrations to a database.
Add the target db-migrate to your project's config in your workspace.json
:
{
"projects": {
"example": {
"targets": {
"db-migrate": {
"executor": "@jujulego/nx-typeorm-plugin:db-migrate"
}
}
}
}
}
Options
name | default | description |
---|---|---|
database | default | Database connection to use (as in the ormconfig.json ) |
Running unit tests
Run nx test nx-typeorm-plugin
to execute the unit tests via Jest.
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago