@prisma/dev 0.0.0-dev.202505282159 → 0.0.0-dev.202505282352
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/daemon/client.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as url from 'url';
|
|
2
2
|
import { SockDaemonClient } from 'sock-daemon/client';
|
|
3
|
-
import { S as ServerOptions, a as Server } from '../index-
|
|
3
|
+
import { S as ServerOptions, a as Server } from '../index-GUbnbqq_.js';
|
|
4
4
|
import { MessageBase } from 'sock-daemon/server';
|
|
5
5
|
|
|
6
6
|
type Kind = "START_SERVER" | "STOP_SERVER";
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
type DBServerPurpose = "database" | "shadow_database";
|
|
2
|
+
|
|
1
3
|
interface ServerOptions {
|
|
2
4
|
/**
|
|
3
5
|
* The port the database server will listen on.
|
|
@@ -50,8 +52,6 @@ interface ServerOptions {
|
|
|
50
52
|
}
|
|
51
53
|
type PersistenceMode = "stateless" | "stateful";
|
|
52
54
|
|
|
53
|
-
type DBServerPurpose = "database" | "shadow_database";
|
|
54
|
-
|
|
55
55
|
declare const DEFAULT_DATABASE_PORT = 51214;
|
|
56
56
|
declare const DEFAULT_SERVER_PORT = 51213;
|
|
57
57
|
declare const DEFAULT_SHADOW_DATABASE_PORT = 51215;
|
|
@@ -64,13 +64,13 @@ declare class PortNotAvailableError extends Error {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
interface Server {
|
|
67
|
-
accelerate: {
|
|
68
|
-
url: string;
|
|
69
|
-
};
|
|
70
67
|
close(): Promise<void>;
|
|
71
68
|
database: {
|
|
72
69
|
connectionString: string;
|
|
73
70
|
};
|
|
71
|
+
http: {
|
|
72
|
+
url: string;
|
|
73
|
+
};
|
|
74
74
|
ppg: {
|
|
75
75
|
url: string;
|
|
76
76
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { D as DEFAULT_DATABASE_PORT, b as DEFAULT_SERVER_PORT, c as DEFAULT_SHADOW_DATABASE_PORT, P as PortAssignableService, d as PortNotAvailableError, a as Server, u as unstable_startServer } from './index-
|
|
1
|
+
export { D as DEFAULT_DATABASE_PORT, b as DEFAULT_SERVER_PORT, c as DEFAULT_SHADOW_DATABASE_PORT, P as PortAssignableService, d as PortNotAvailableError, a as Server, u as unstable_startServer } from './index-GUbnbqq_.js';
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{
|
|
3
|
-
`).find(
|
|
4
|
-
Received data: ${
|
|
2
|
+
import{HTTPException as E}from"hono/http-exception";import{object as ye,optional as we,parseJson as be,pipe as I,regex as U,safeParse as Se,string as _,url as F}from"valibot";var q=/^(postgres|postgresql):\/\//,Pe=I(_(),be(),ye({databaseUrl:I(_(),F(),U(q)),shadowDatabaseUrl:we(I(_(),F(),U(q)))}));function V(t){return Buffer.from(JSON.stringify(t),"utf8").toString("base64url")}function ve(t){let e=Buffer.from(t,"base64url").toString("utf8"),{issues:r,output:n,success:o}=Se(Pe,e,{abortEarly:!0});return o?[null,n]:[r]}var g=(t,e)=>{let{authorization:r}=t;if(!r)throw new E(401,{message:"Missing API Key"});let[n,o="",s]=r.split(" ");if(n!=="Bearer"||s)throw new E(401,{message:"Invalid API Key"});let[i,a]=ve(o);if(i)throw new E(401,{message:"Invalid API Key",cause:i.join(", ")});let{databaseUrl:c}=a;if(c!==e.var.db.connectionString)throw new E(401,{message:"Wrong API Key; Check your Prisma schema's `provider.url` value (probably defined in `.env`'s `DATABASE_URL` environment variable) is aligned with `prisma dev`'s output"});return{decodedAPIKey:a}};import{PGlite as Ee}from"@electric-sql/pglite";import{PGLiteSocketServer as Te}from"@electric-sql/pglite-socket";import{pgDump as De}from"@electric-sql/pglite-tools/pg_dump";var K=51214,Q=51213,G=51215,h=class extends Error{constructor(r,n){super(`Port number \`${r}\` is not available for service ${n}.`);this.port=r;this.service=n}name="PortNotAvailableError"};var d={connectionLimit:1,connectTimeout:0,database:"template1",maxIdleConnectionLifetime:0,password:"postgres",poolTimeout:0,socketTimeout:0,sslMode:"disable",username:"postgres"},Ae=`postgres://${d.username}:${d.password}@localhost`,Re=new URLSearchParams({connection_limit:String(d.connectionLimit),connect_timeout:String(d.connectTimeout),max_idle_connection_lifetime:String(d.maxIdleConnectionLifetime),pool_timeout:String(d.poolTimeout),socket_timeout:String(d.socketTimeout),sslmode:d.sslMode});async function $(t,e){let r=t==="database"?e.databasePort:e.shadowDatabasePort;if(e.dryRun)return J(t,e,{db:null,port:r,server:null});let{debug:n}=e,o=await Ee.create({database:d.database,dataDir:t==="database"?e.pgliteDataDirPath:"memory://",debug:n?5:void 0,defaultDataTransferContainer:"file",relaxedDurability:!1,username:d.username});n&&o.onNotification((i,a)=>{console.debug(`[${t}][${i}] ${a}`)});let s=new Te({db:o,debug:n,inspect:n,port:r});n&&(s.addEventListener("listening",i=>{let{detail:a}=i;console.debug(`[${t}] server listening on ${JSON.stringify(a)}`)}),s.addEventListener("connection",i=>{let{clientAddress:a,clientPort:c}=i.detail;console.debug(`[${t}] client connected from ${a}:${c}`)}),s.addEventListener("error",i=>{let{detail:a}=i;console.error(`[${t}] server error:`,a)}));try{await s.start()}catch(i){throw i instanceof Error&&"code"in i&&i.code==="EADDRINUSE"?new h(r,t):i}return J(t,e,{db:o,port:r,server:s})}function J(t,e,r){let{debug:n}=e,{db:o,port:s,server:i}=r||{};return n&&console.debug(`[${t}] server started on port ${s}`),{...d,close:async()=>{let a=[];try{await i?.stop(),n&&console.debug(`[${t}] server stopped on port ${s}`)}catch(c){console.error(`[${t}] server stop error`,c),a.push(c)}if(t==="database")try{await o?.syncToFs(),n&&console.debug(`[${t}] synced to filesystem`)}catch(c){console.error(`[${t}] sync error`,c),a.push(c)}try{await o?.close(),n&&console.debug(`[${t}] closed`)}catch(c){console.error(`[${t}] close error`,c),a.push(c)}if(a.length>0)throw new AggregateError(a,`Failed to close ${t} properly`)},connectionString:Oe(s),dump:async()=>!o||t==="shadow_database"?{dumpPath:"<DUMP_PATH>"}:await e.writeDatabaseDump(()=>De({args:["--format=custom","--quote-all-identifiers","--schema-only","--verbose"],pg:o})),port:s}}function Oe(t){return`${Ae}:${t}/${d.database}?${Re.toString()}`}import{createServer as gt}from"http";import{promisify as ht}from"util";import{serve as ft}from"@hono/node-server";import yt from"@prisma/get-platform";function T(){let t,e,r=new Promise((s,i)=>{t=s,e=i}),n=s=>{n=o=null,e(s)},o=s=>{o=n=null,t(s)};return{promise:r,reject:s=>n?.(s),resolve:s=>o?.(s)}}import{logger as wt}from"hono/logger";import{Hono as ge}from"hono/tiny";import{Hono as dt}from"hono/tiny";import{validator as S}from"hono/validator";import{array as xe,literal as Ie,minLength as _e,object as $e,pipe as He,safeParse as ke,string as Be,union as Ce}from"valibot";var Le=$e({tags:Ce([He(xe(Be()),_e(1)),Ie("all")])});async function z(t){let{output:e,success:r}=ke(Le,await t.req.json(),{abortEarly:!0});return r?e:t.text("Invalid input",400)}import{spawn as Ge}from"child_process";import{once as Je}from"events";import{mkdir as ze}from"fs/promises";import{join as We}from"path";import{setTimeout as Ye}from"timers/promises";import{proxySignals as Xe}from"foreground-child/proxy-signals";import{process as Ze}from"std-env";import{createWriteStream as Me,WriteStream as je}from"fs";import{access as Ne,chmod as Ue,constants as Fe,writeFile as qe}from"fs/promises";import Ve from"env-paths";import{inflate as Ke}from"pako";var W=Ve("prisma-dev");function Y(t,e){return`${W.cache}/engine/${t}/${e}`}function X(t){return`${W.data}/${t}`}async function Z(t){try{return await Ne(t,Fe.F_OK),!0}catch(e){if(Qe(e))return!1;throw e}}async function ee(t,e){let r=Ke(t);await qe(e,r),await Ue(e,"755")}async function te(t,e){await t.stream().pipeTo(je.toWeb(Me(e,{encoding:"utf-8"})))}function Qe(t){return t!=null&&typeof t=="object"&&"code"in t&&t.code==="ENOENT"}var{PRISMA_DEV_FORCE_ENGINE_BINARY_DOWNLOAD:et,PRISMA_DEV_FORCE_ENGINE_BINARY_PATH:tt,PRISMA_DEV_FORCE_NETWORK_DELAY_MS:re}=Ze.env,y=class t{static#t=new Map;#e;#r;constructor(e){this.#e=e,this.#r=null}static async get(e){let{debug:r}=e,n=`${e.schemaHash}:${e.clientVersion}`;try{let o=t.#t.get(n);if(o)return o;let s=new t(e);return t.#t.set(n,s),r&&console.debug("[Query Engine] starting...",e),await s.start(),r&&console.debug("[Query Engine] started!"),s}finally{t.stopAll(n)}}static async stopAll(e){let n=(await Promise.allSettled(Array.from(t.#t.entries()).filter(([o])=>o!==e).map(async([o,s])=>{try{await s.stop()}finally{t.#t.delete(o)}}))).filter(o=>o.status==="rejected").map(o=>o.reason);if(n.length>0)throw new AggregateError(n,"Failed to stop engines")}async commitTransaction(e,r){return await this.#i(e,r,"commit")}async request(e,r){let{url:n}=await this.start(),o=this.#s(r),s=await fetch(n,{body:typeof e=="string"?e:JSON.stringify(e),headers:{...o,"Content-Type":"application/json"},method:"POST"});if(!s.ok)throw await f.fromResponse(s);return await s.text()}async rollbackTransaction(e,r){return await this.#i(e,r,"rollback")}async startTransaction(e,r){let{url:n}=await this.start(),o=this.#s(r),s=await fetch(`${n}/transaction/start`,{body:JSON.stringify(e),headers:{...o,"Content-Type":"application/json"},method:"POST"});if(!s.ok)throw await f.fromResponse(s);return await s.json()}async start(){if(this.#r!=null)return await this.#r;let{promise:e,reject:r,resolve:n}=T();this.#r=e;let o=tt||await this.#o();this.#e.debug&&console.debug("[Query Engine] spinning up at path...",o);let s=Ge(o,["--enable-raw-queries","--enable-telemetry-in-response","--port","0"],{env:{LOG_QUERIES:"y",PRISMA_DML:this.#e.base64Schema,QE_LOG_LEVEL:"TRACE",RUST_BACKTRACE:"1",RUST_LOG:"info"},stdio:["ignore","pipe","pipe"],windowsHide:!0});Xe(s),s.stderr.setEncoding("utf8"),s.stdout.setEncoding("utf8");let i=u=>{let m=u.split(`
|
|
3
|
+
`).find(fe=>fe.includes("Started query engine http server"));if(!m)return;s.stdout.removeListener("data",i);let{fields:p}=JSON.parse(m);if(p==null)return r(new Error(`Unexpected data during initialization, "fields" are missing: ${u}`));let{ip:l,port:N}=p;if(l==null||N==null)return r(new Error(`This version of query-engine is not compatible with minippg, "ip" and "port" are missing in the startup log entry.
|
|
4
|
+
Received data: ${u}`));n({childProcess:s,url:`http://${l}:${N}`})},a=u=>{this.#r=null,r(new b(String(u))),s.removeListener("exit",c),s.kill()};s.once("error",a);let c=(u,m)=>{this.#r=null,r(new b(`Query Engine exited with code ${u} and signal ${m}`))};return s.once("exit",c),s.stdout.on("data",i),this.#e.debug&&(s.stderr.on("data",console.error.bind(console,"[Query Engine]")),s.stdout.on("data",console.debug.bind(console,"[Query Engine]"))),await this.#r}async stop(){if(this.#r==null)return;let{childProcess:e}=await this.#r;e.exitCode==null&&e.signalCode==null&&(this.#r=null,e.kill(),await Je(e,"exit"))}async#o(){this.#e.debug&&console.debug("[Query Engine] getting engine commit hash...");let e=await this.#n();this.#e.debug&&console.debug("[Query Engine] got engine commit hash",e);let r=Y(this.#e.clientVersion,e);this.#e.debug&&console.debug("[Query Engine] cache directory path",r),await ze(r,{recursive:!0});let{platform:n}=this.#e.platform,o=n==="windows"?".exe":"",s=We(r,`query-engine-${n}${o}`);return this.#e.debug&&console.debug("[Query Engine] binary path",s),(et==="1"||await Z(s)===!1)&&await this.#a({commitHash:e,extension:o,engineBinaryPath:s}),s}async#n(){let e=await fetch(`https://registry.npmjs.org/@prisma/client/${this.#e.clientVersion}`);if(!e.ok)throw new Error(`Couldn't fetch package.json from npm registry, status code: ${e.status}`);let n=(await e.json()).devDependencies?.["@prisma/engines-version"];if(!n)throw new Error("Couldn't find engines version in package.json");let o=n.split(".").at(-1);if(!o)throw new Error("Couldn't find commit hash in engines version");return o}async#a(e){let{commitHash:r,extension:n,engineBinaryPath:o}=e,{binaryTarget:s}=this.#e.platform,i=`https://binaries.prisma.sh/all_commits/${r}/${s}/query-engine${n}.gz`;this.#e.debug&&console.debug("[Query Engine] downloading engine from url",i);let a=await fetch(i);if(!a.ok)throw new Error(`Couldn't download engine. URL: ${i}, status code: ${a.status}`);re&&await Ye(Number(re)),await ee(await a.arrayBuffer(),o),this.#e.debug&&console.debug("[Query Engine] downloaded and saved at",o)}#s(e){let r={};for(let[n,o]of Object.entries(e))o!=null&&(r[n]=o);return r}async#i(e,r,n){let{url:o}=await this.#r,s=this.#s(r),i=await fetch(`${o}/transaction/${e}/${n}`,{headers:{...s,"Content-Type":"application/json"},method:"POST"});if(!i.ok)throw await f.fromResponse(i);try{return await i.json()}catch{return{}}}};function D(t,e){return console.error(t),t instanceof b?e.json({EngineNotStarted:{reason:{EngineStartupError:{logs:[],msg:t.message}}}},500):t instanceof f?e.text(t.responseBody,t.statusCode):e.body(null,500)}var b=class extends Error{name="EngineStartError"},f=class t extends Error{constructor(r,n,o){super(`${r}: Query Engine response status ${n}, body: ${o}`);this.action=r;this.statusCode=n;this.responseBody=o}name="EngineHttpError";static async fromResponse(r){let n=new URL(r.url),o=await r.text();return new t(n.pathname,r.status,o)}};import{Buffer as ne}from"buffer";var A=new Map;async function H(t){let r=new TextEncoder().encode(t),n=await crypto.subtle.digest("SHA-256",r);return Array.from(new Uint8Array(n)).map(i=>i.toString(16).padStart(2,"0")).join("")}function oe(t){let e=t.req.param("schemaHash"),r=A.get(e);return r==null?t.json({EngineNotStarted:{reason:"SchemaMissing"}},404):{schemaHash:e,schemas:r}}var rt=/datasource\s+db\s+\{\s*provider\s*=\s*"postgres(!?ql)?"\s+url\s*=\s*.+\s*\}/;async function se(t,e){let r=ne.from(t,"base64").toString("utf8"),n=`datasource db {
|
|
5
5
|
provider = "postgresql"
|
|
6
6
|
url = "${e.toString()}"
|
|
7
|
-
}`,o=r.replace(
|
|
8
|
-
`,{encoding:"utf-8"})}
|
|
7
|
+
}`,o=r.replace(rt,n),s=await H(o);return{base64Override:ne.from(o,"utf8").toString("base64"),overrideHash:s}}function R(t){let{req:e}=t;return{traceparent:e.header("traceparent"),"X-capture-telemetry":e.header("X-capture-telemetry")}}import{integer as ie,looseObject as nt,minValue as ae,number as k,object as ot,optional as st,pipe as ce,safeParse as de,string as ue,union as it}from"valibot";var at=ot({isolation_level:st(ue()),max_wait:ce(k(),ie(),ae(0)),timeout:ce(k(),ie(),ae(0))});async function le(t){let{issues:e,output:r,success:n}=de(at,await t.req.json(),{abortEarly:!0});return n?r:t.json({EngineNotStarted:{reason:"InvalidRequest",issues:e}},400)}var ct=nt({id:it([ue(),k()])});function me(t,e){let{output:r,success:n}=de(ct,t);return n?r:e.json({EngineMalfunction:{}},500)}var P=new dt;P.post("/invalidate",S("header",g),async t=>{let e=await z(t);return e instanceof Response?e:t.body(null)});var ut="/:clientVersion/:schemaHash",v=P.basePath(ut);P.route("/",v);var lt=["/graphql","/itx/:transactionId/graphql"];v.on("POST",[...lt],S("header",g),async t=>{let{req:e}=t;try{let r=await B(t);if(r instanceof Response)return r;let n=await e.text(),o=e.param("transactionId"),s=await r.request(n,{...R(t),"X-transaction-id":o});return t.text(s)}catch(r){return D(r,t)}});v.basePath("/itx/:transactionId").on("POST",["/commit","/rollback"],S("header",g),async t=>{let{req:e}=t;try{let r=await B(t);if(r instanceof Response)return r;let o=`${e.routePath.split("/").filter(Boolean).at(-1)}Transaction`,s=e.param("transactionId"),i=await r[o](s,R(t));return t.json(i)}catch(r){return D(r,t)}});v.put("/schema",S("header",g),async t=>{let{req:e}=t,r=await e.text();if(!r)return t.text("Missing schema",400);let n=e.param("schemaHash"),o=A.get(n);if(o==null){if(n!==await H(r))return t.text("Schema hash mismatch",400);let s=new URL(t.get("db").connectionString);s.searchParams.set("single_use_connections","true");let i=await se(r,s);return A.set(n,{base64Original:r,...i}),t.text(n)}return r!==o.base64Original?t.text("Schema mismatch",400):t.text(n)});v.post("/transaction/start",S("header",g),async t=>{let{req:e}=t,r=await le(t);if(r instanceof Response)return r;try{let n=await B(t);if(n instanceof Response)return n;let o=await n.startTransaction(r,R(t)),s=me(o,t);if(s instanceof Response)return s;let{id:i}=s,a=e.param("clientVersion"),c=t.get("port"),u=t.get("protocol"),m=e.param("schemaHash");return t.json({...o,"data-proxy":{endpoint:`${u}://localhost:${c}/${a}/${m}/itx/${i}`}})}catch(n){return D(n,t)}});async function B(t){let{req:e}=t,r=oe(t);if(r instanceof Response)return r;let{base64Override:n,overrideHash:o}=r.schemas;return await y.get({base64Schema:n,clientVersion:process.env.PRISMA_DEV_FORCE_CLIENT_VERSION||e.param("clientVersion"),debug:t.get("debug"),platform:t.get("platform"),schemaHash:o})}import{Hono as mt}from"hono/tiny";import{StatusCodes as pt}from"http-status-codes";var O=new mt;O.post("/database/dump",async t=>{let r=await t.get("db").dump();return t.json(r,pt.CREATED)});O.get("/health",t=>t.json({name:t.get("serverState").name}));async function he(t,e){let{port:r}=e;if(e.dryRun)return pe(r,null);let n=await bt(r,t,e),{promise:o,reject:s,resolve:i}=T(),a=ft({createServer:gt,fetch:n.fetch,port:r},i);return a.on("error",c=>{if(typeof c=="object"&&"code"in c&&c.code==="EADDRINUSE")return s(new h(r,"server"));console.error("[Accelerate]",c)}),await o,pe(r,a)}function pe(t,e){return{async close(){e&&await Promise.allSettled([ht(e.close.bind(e))(),y.stopAll()])},port:t,url:`http://localhost:${t}`}}async function bt(t,e,r){let{debug:n}=r,o=new ge,s=await yt.getPlatformInfo();return n&&console.debug("[Accelerate] platform info: %s",JSON.stringify(s)),n&&o.use("*",wt((...i)=>console.log("[Accelerate]",...i))),o.use("*",async(i,a)=>(i.set("db",e),i.set("debug",!!n),i.set("platform",s),i.set("port",t),i.set("protocol","http"),i.set("serverState",r),await a())),o.route("/",C),o}var C=new ge;C.route("/",P);C.route("/",O);import{mkdir as St,writeFile as Pt}from"fs/promises";import{join as x}from"pathe";import{lock as vt}from"proper-lockfile";import{process as Et}from"std-env";var j=Symbol("initialize"),w=class{databasePort;debug;dryRun;name;persistenceMode;port;shadowDatabasePort;constructor(e){this.databasePort=e.databasePort??51214,this.debug=e.debug??!1,this.dryRun=e.dryRun??!1,this.name=e.name??"default",this.persistenceMode=e.persistenceMode,this.port=e.port??51213,this.shadowDatabasePort=e.shadowDatabasePort??51215}static async get(e){let r=e?.dryRun!==!0&&e?.persistenceMode!=="stateless"?new M(e):new L(e);return await r[j](),r}},L=class extends w{constructor(e){super({...e,persistenceMode:"stateless"})}get pgliteDataDirPath(){return"memory://"}async[j](){}async close(){}writeDatabaseDump(){return Promise.resolve({dumpPath:"<DUMP_PATH>"})}async writeServerDump(){}},M=class extends w{#t;#e;#r;#o;#n=null;constructor(e){super({...e,persistenceMode:"stateful"}),this.#t=X(this.name),this.#e=x(this.#t,"dump.sql"),this.#r=x(this.#t,".pglite"),this.#o=x(this.#t,"server.json")}get pgliteDataDirPath(){return this.#r}async[j](){await St(this.#t,{recursive:!0}),this.debug&&console.debug(`[State] using data directory: ${this.#t}`);try{this.#n=await vt(this.#t,{lockfilePath:x(this.#t,".lock")}),this.debug&&console.debug(`[State] obtained lock on: ${this.#t}`),await this.writeServerDump()}catch(e){throw e instanceof Error&&"code"in e&&e.code==="ELOCKED"?new Error(`A server with the name "${this.name}" is already running. `):e}}async close(){this.#n!=null&&(await this.#n(),this.debug&&console.debug(`[State] released lock on: ${this.#t}`))}async writeDatabaseDump(e){let r=await e();return await te(r,this.#e),this.debug&&console.debug(`dumped database to: ${this.#e}`),{dumpPath:this.#e}}async writeServerDump(e){await Pt(this.#o,`${JSON.stringify({name:this.name,version:"1",pid:Et.pid,port:this.port,databasePort:this.databasePort,shadowDatabasePort:this.shadowDatabasePort,exports:e},null,2)}
|
|
8
|
+
`,{encoding:"utf-8"})}};async function Mr(t){let e=await w.get(t),[r,n]=await Promise.all([$("database",e),$("shadow_database",e)]),o=await he(r,e),s=`prisma+postgres://localhost:${o.port}/?${new URLSearchParams({api_key:V({databaseUrl:r.connectionString,shadowDatabaseUrl:n.connectionString})}).toString()}`,i={database:{connectionString:r.connectionString},http:{url:o.url},ppg:{url:s},shadowDatabase:{connectionString:n.connectionString}};return await e.writeServerDump(i),{...i,close:()=>a(e,[o,r,n])};async function a(c,u){let p=(await Promise.allSettled(u.map(l=>l.close()))).filter(l=>l.status==="rejected").map(l=>new Error(l.reason));try{await c.close()}catch(l){p.push(l)}if(p.length>0)throw new AggregateError(p,"Failed to close some servers")}}export{K as DEFAULT_DATABASE_PORT,Q as DEFAULT_SERVER_PORT,G as DEFAULT_SHADOW_DATABASE_PORT,h as PortNotAvailableError,Mr as unstable_startServer};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/dev",
|
|
3
|
-
"version": "0.0.0-dev.
|
|
3
|
+
"version": "0.0.0-dev.202505282352",
|
|
4
4
|
"description": "A local Prisma Postgres server for development and testing",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"env-paths": "3.0.0",
|
|
52
52
|
"foreground-child": "3.3.1",
|
|
53
53
|
"hono": "4.7.10",
|
|
54
|
+
"http-status-codes": "2.3.0",
|
|
54
55
|
"pako": "2.1.0",
|
|
55
56
|
"pathe": "2.0.3",
|
|
56
57
|
"proper-lockfile": "4.1.2",
|