Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@amplication/plugin-db-mongo

Package Overview
Dependencies
Maintainers
8
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@amplication/plugin-db-mongo - npm Package Compare versions

Comparing version 1.4.9-beta.0 to 1.4.9-beta.1

2

package.json
{
"name": "@amplication/plugin-db-mongo",
"version": "1.4.9-beta.0",
"version": "1.4.9-beta.1",
"description": "Use a Mongo database in a service generated by Amplication",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -60,3 +60,3 @@ import {

beforeCreateServer(context: DsgContext, eventParams: CreateServerParams) {
private static autoIncrementDataTypeValidation(context: DsgContext): void {
const generateErrorMessage =

@@ -81,3 +81,25 @@ () => `The ID type: "Auto increment" is not supported by MongoDB Prisma provider.

}
}
private static decimalDataTypeValidation(context: DsgContext): void {
const generateErrorMessage =
() => `The 'Decimal' field type is currently not supported with MongoDB.
Please use an alternative field type.`;
const allDecimalFields = context.entities?.filter((entity) =>
entity.fields.find(
(field) => field.dataType === EnumDataType.DecimalNumber
)
);
if (allDecimalFields !== undefined && allDecimalFields.length > 0) {
context.logger.error(generateErrorMessage());
throw new Error(generateErrorMessage());
}
}
beforeCreateServer(context: DsgContext, eventParams: CreateServerParams) {
MongoPlugin.autoIncrementDataTypeValidation(context);
MongoPlugin.decimalDataTypeValidation(context);
return eventParams;

@@ -84,0 +106,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc