@prisma/dev
Version:
A local Prisma Postgres server for development and testing
2 lines (1 loc) • 1.36 kB
JavaScript
import{a}from"./chunk-FB4QA6EA.js";import"./chunk-662IKR3V.js";import"./chunk-PP43TGA5.js";import"./chunk-KWCQYPJI.js";import"./chunk-HFONW2ZS.js";import"./chunk-ANHBRJRZ.js";import"./chunk-EDFHV3AK.js";import"./chunk-DWY47FQV.js";import"./chunk-DOJAPHLY.js";import{setTimeout as o}from"timers/promises";var e;process.once("SIGTERM",()=>{console.log("SIGTERM received, shutting down..."),process.removeAllListeners("SIGINT"),process.exitCode=143,e?.close().finally(()=>process.exit())});process.once("SIGINT",()=>{console.log("SIGINT received, shutting down..."),process.removeAllListeners("SIGTERM"),process.exitCode=130,e?.close().finally(()=>process.exit())});async function n(){let[,,t]=process.argv;if(!t)return process.send?.({type:"error",error:'Missing "name" argument, server cannot be started'},void 0),process.exit(1);try{e=await a({debug:!0,persistenceMode:"stateful",name:t});let r=e.experimental.queryInsights,s={database:e.database,experimental:{queryInsights:{serverUrl:r.serverUrl,sqlitePath:r.sqlitePath,streamName:r.streamName,url:r.url},streams:e.experimental.streams},http:e.http,name:e.name,ppg:e.ppg,shadowDatabase:e.shadowDatabase};process.send?.({type:"started",server:s},void 0)}catch(r){console.error(r);let s=r instanceof Error?r.message:String(r);process.send?.({type:"error",error:s},void 0),await o(1e3),process.exit(1)}}n();