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

@prisma/engine-core

Package Overview
Dependencies
Maintainers
5
Versions
5964
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@prisma/engine-core - npm Package Compare versions

Comparing version 0.0.31 to 0.0.32

1

dist/NodeEngine.d.ts

@@ -51,2 +51,3 @@ /// <reference types="node" />

start(): Promise<void>;
fail: (e: any, why: any) => void;
/**

@@ -53,0 +54,0 @@ * If Prisma runs, stop it

34

dist/NodeEngine.js

@@ -31,6 +31,6 @@ "use strict";

const cross_fetch_1 = __importDefault(require("cross-fetch"));
const getInternalDatamodelJson_1 = require("./getInternalDatamodelJson");
const Engine_1 = require("./Engine");
const debug = debug_1.default('engine');
const readFile = util_1.promisify(fs.readFile);
const exists = util_1.promisify(fs.exists);
/**

@@ -50,2 +50,6 @@ * Node.js based wrapper to run the Prisma binary

this.errorLogs = '';
this.fail = (e, why) => {
debug(e, why);
this.stop();
};
/**

@@ -79,2 +83,5 @@ * If Prisma runs, stop it

async getPrismaYml(ymlPath) {
if (!exists(ymlPath)) {
return undefined;
}
return await readFile(ymlPath, 'utf-8');

@@ -94,7 +101,7 @@ }

const schemaEnv = {};
if (!this.datamodelJson) {
this.datamodelJson = await getInternalDatamodelJson_1.getInternalDatamodelJson(this.datamodel, this.schemaInferrerPath);
}
debug(`Starting binary at ${this.prismaPath}`);
const env = Object.assign({ PRISMA_CONFIG, PRISMA_SDL: this.datamodel, PRISMA_DML: '', SERVER_ROOT: process.cwd(), PRISMA_INTERNAL_DATA_MODEL_JSON: this.datamodelJson }, schemaEnv);
const env = {
PRISMA_CONFIG,
PRISMA_DML: this.datamodel,
};
debug(env);

@@ -121,13 +128,10 @@ this.child = child_process_1.spawn(this.prismaPath, [], {

if (code !== 0 && !this.exiting) {
const debugString = this.debug
? ''
: 'Please enable "debug": true in the Engine constructor to get more insights.';
throw new Error(`Child exited with code ${code}${debugString}${e}`);
throw new Engine_1.PhotonError(`Error in query engine: ` + this.errorLogs, undefined, undefined, this.errorLogs);
}
});
// Make sure we kill Rust when this process is being killed
process.once('SIGTERM', this.stop);
process.once('SIGINT', this.stop);
process.once('uncaughtException', this.stop);
process.once('unhandledRejection', this.stop);
process.once('SIGTERM', e => this.fail(e, 'SIGTERM'));
process.once('SIGINT', e => this.fail(e, 'SIGINT'));
// process.once('uncaughtException', e => this.fail(e, 'uncaughtException'))
// process.once('unhandledRejection', e => this.fail(e, 'unhandledRejection'))
await this.engineReady();

@@ -187,3 +191,3 @@ const url = `http://localhost:${this.port}`;

debug(e.message);
if (tries >= 100) {
if (tries >= 10) {
throw e;

@@ -250,3 +254,3 @@ }

const stringified = errors ? JSON.stringify(errors, null, 2) : null;
const message = stringified.length > 0 ? stringified : `Error in prisma.\$\{rootField || 'query'}`;
const message = stringified.length > 0 ? stringified : `Error in photon.\$\{rootField || 'query'}`;
const isPanicked = this.errorLogs.includes('panicked');

@@ -253,0 +257,0 @@ if (isPanicked) {

{
"name": "@prisma/engine-core",
"version": "0.0.31",
"version": "0.0.32",
"license": "Apache-2.0",

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

Sorry, the diff of this file is not supported yet

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