@amplication/plugin-db-mongo
Advanced tools
Comparing version 1.4.7 to 1.4.8-beta.pr-289.0d3954c
{ | ||
"name": "@amplication/plugin-db-mongo", | ||
"version": "1.4.7", | ||
"version": "1.4.8-beta.pr-289.0d3954c", | ||
"description": "Use a Mongo database in a service generated by Amplication", | ||
"main": "dist/index.js", | ||
"nx": {}, | ||
"scripts": { | ||
@@ -16,3 +17,4 @@ "dev": "webpack --watch", | ||
"devDependencies": { | ||
"@amplication/code-gen-types": "^2.0.4", | ||
"@amplication/code-gen-types": "^2.0.17", | ||
"@amplication/code-gen-utils": "^0.0.7", | ||
"@babel/parser": "^7.18.11", | ||
@@ -19,0 +21,0 @@ "@babel/types": "^7.18.10", |
# @amplication/plugin-db-mongo | ||
[![NPM Downloads](https://img.shields.io/npm/dt/@amplication/plugin-db-mongo)](https://www.npmjs.com/package/@amplication/plugin-db-mongo) | ||
[![NPM Downloads](https://img.shields.io/npm/dt/@amplication/plugin-db-mongo)](https://www.npmjs.com/package/@amplication/plugin-db-mongo) | ||
@@ -11,14 +11,16 @@ Use a Mongo DB database in the service generated by Amplication. | ||
It updates the following parts: | ||
- Updates the datasource on the `schema.prisma` file: | ||
- For versions older than `1.3.3` the datesource name is based on the database type | ||
- MongoDB - the datasource name is `mongo` | ||
- From version `1.3.3` the datasource name is `db`, no matter what is the database type | ||
- For versions older than `1.3.3` the datesource name is based on the database type | ||
- MongoDB - the datasource name is `mongo` | ||
- From version `1.3.3` the datasource name is `db`, no matter what is the database type | ||
- From version `1.3.3` as the datasouce name is `db`, all the custom attributes that use the `@{datasource.name}.{nameOfTheAttribute}` are replaced with `@db.{nameOfTheAttribute}` | ||
- Adds the requires services and variables to `docker-compose.yml` | ||
- Add the `db` service to the `docker-compose.dev.yml` | ||
- Add the `db` service to the `docker-compose.dev.yml` | ||
- Add the requires environment variables to `.env` | ||
- Update package json file in order to support only the relevant prisma mongo commands | ||
- Update package json file in order to support only the relevant prisma mongo commands | ||
- Change prisma schema fields according to the prisma mongo conventions | ||
## Configuration | ||
The plugin uses the parameters configured on the database tab on the service settings page | ||
@@ -28,6 +30,6 @@ | ||
## Usage | ||
This plugin integrates with the all default tasks and scripts used by the generated service: | ||
```json | ||
@@ -44,2 +46,2 @@ "seed": "ts-node scripts/seed.ts", | ||
"compose:down": "docker-compose down --volumes" | ||
``` | ||
``` |
@@ -44,3 +44,3 @@ import { CreateServerDockerComposeParams } from "@amplication/code-gen-types"; | ||
healthcheck: { | ||
test: 'test $$(mongosh --quiet -u $${MONGO_INITDB_ROOT_USERNAME} -p $${MONGO_INITDB_ROOT_PASSWORD} --eval "try { rs.initiate({ _id: \'"rs0"\',members: [{ _id: 0, host: \'"localhost"\' }] }).ok } catch (_) { rs.status().ok}") -eq 1', | ||
test: "test $$(mongosh --quiet -u $${MONGO_INITDB_ROOT_USERNAME} -p $${MONGO_INITDB_ROOT_PASSWORD} --eval \"try { rs.initiate({ _id: 'rs0',members: [{ _id: 0, host: 'db' }] }).ok } catch (_) { rs.status().ok}\") -eq 1", | ||
start_period: "5s", | ||
@@ -47,0 +47,0 @@ interval: "10s", |
{ | ||
"extends": "../../tsconfig.base.json", | ||
"include": [ | ||
"src/index.ts" | ||
], | ||
"exclude": [ | ||
"node_modules" | ||
], | ||
} | ||
"include": ["src/index.ts"], | ||
"exclude": ["node_modules"] | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
207766
19
2418
45
24
2