@prisma/dev 0.0.0-dev.202506062140 → 0.0.0-dev.202506070637
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/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var dt=Object.create;var j=Object.defineProperty;var lt=Object.getOwnPropertyDescriptor;var pt=Object.getOwnPropertyNames;var mt=Object.getPrototypeOf,gt=Object.prototype.hasOwnProperty;var ft=(t,e)=>{for(var r in e)j(t,r,{get:e[r],enumerable:!0})},le=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of pt(e))!gt.call(t,o)&&o!==r&&j(t,o,{get:()=>e[o],enumerable:!(n=lt(e,o))||n.enumerable});return t};var $=(t,e,r)=>(r=t!=null?dt(mt(t)):{},le(e||!t||!t.__esModule?j(r,"default",{value:t,enumerable:!0}):r,t)),ht=t=>le(j({},"__esModule",{value:!0}),t);var Mt={};ft(Mt,{DEFAULT_DATABASE_PORT:()=>De,DEFAULT_SERVER_PORT:()=>Ee,DEFAULT_SHADOW_DATABASE_PORT:()=>Ae,PortNotAvailableError:()=>v,unstable_startServer:()=>jt});module.exports=ht(Mt);var P=require("hono/http-exception"),l=require("valibot"),pe=/^(postgres|postgresql):\/\//,yt=(0,l.pipe)((0,l.string)(),(0,l.parseJson)(),(0,l.object)({databaseUrl:(0,l.pipe)((0,l.string)(),(0,l.url)(),(0,l.regex)(pe)),name:(0,l.optional)((0,l.pipe)((0,l.string)(),(0,l.minLength)(1))),shadowDatabaseUrl:(0,l.pipe)((0,l.string)(),(0,l.url)(),(0,l.regex)(pe))}));function me(t){return Buffer.from(JSON.stringify(Object.fromEntries(Object.entries(t).sort(([[e],[r]])=>e.localeCompare(r)))),"utf8").toString("base64url")}function St(t){let e=Buffer.from(t,"base64url").toString("utf8"),{issues:r,output:n,success:o}=(0,l.safeParse)(yt,e,{abortEarly:!0});return o?[null,n]:[r]}var A=(t,e)=>{let{authorization:r}=t;if(!r)throw new P.HTTPException(401,{message:"Missing API Key"});let[n,o="",s]=r.split(" ");if(n!=="Bearer"||s)throw new P.HTTPException(401,{message:"Invalid API Key"});let[i,a]=St(o);if(i)throw new P.HTTPException(401,{message:"Invalid API Key",cause:i.join(", ")});let{databaseUrl:c,name:m,shadowDatabaseUrl:S}=a,{name:b}=e.get("serverState");if(!m)throw new P.HTTPException(401,{message:`Wrong API Key; The server running at port ${e.get("port")} requires an API Key from a newer version of \`prisma dev\`. Check the "${b}" server's output for the updated \`DATABASE_URL\` value.`});if(m!==b)throw new P.HTTPException(401,{message:`Wrong API Key; The server running at port ${e.get("port")} is named "${b}", but the API Key is for "${m}"`});let{hostname:y,port:L}=new URL(c),{port:J}=e.get("db"),{hostname:at,port:ct}=new URL(S),ut=e.get("shadowDBPort");if(y!=="localhost"||Number(L)!==J||at!=="localhost"||Number(ct)!==ut)throw new P.HTTPException(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}};var Y=require("@electric-sql/pglite"),Te=require("@electric-sql/pglite-socket"),xe=require("pathe/utils");var N=require("fs"),h=require("fs/promises");var p=$(require("path"),1),Q=$(require("os"),1),M=$(require("process"),1),w=Q.default.homedir(),W=Q.default.tmpdir(),{env:R}=M.default,bt=t=>{let e=p.default.join(w,"Library");return{data:p.default.join(e,"Application Support",t),config:p.default.join(e,"Preferences",t),cache:p.default.join(e,"Caches",t),log:p.default.join(e,"Logs",t),temp:p.default.join(W,t)}},wt=t=>{let e=R.APPDATA||p.default.join(w,"AppData","Roaming"),r=R.LOCALAPPDATA||p.default.join(w,"AppData","Local");return{data:p.default.join(r,t,"Data"),config:p.default.join(e,t,"Config"),cache:p.default.join(r,t,"Cache"),log:p.default.join(r,t,"Log"),temp:p.default.join(W,t)}},Pt=t=>{let e=p.default.basename(w);return{data:p.default.join(R.XDG_DATA_HOME||p.default.join(w,".local","share"),t),config:p.default.join(R.XDG_CONFIG_HOME||p.default.join(w,".config"),t),cache:p.default.join(R.XDG_CACHE_HOME||p.default.join(w,".cache"),t),log:p.default.join(R.XDG_STATE_HOME||p.default.join(w,".local","state"),t),temp:p.default.join(W,e,t)}};function z(t,{suffix:e="nodejs"}={}){if(typeof t!="string")throw new TypeError(`Expected a string, got ${typeof t}`);return e&&(t+=`-${e}`),M.default.platform==="darwin"?bt(t):M.default.platform==="win32"?wt(t):Pt(t)}var ge=require("pako"),fe=z("prisma-dev");function he(t,e){return`${fe.cache}/engine/${t}/${e}`}function _(t){return`${fe.data}/${t}`}async function ye(t){try{return await(0,h.access)(t,h.constants.F_OK),!0}catch(e){if(X(e))return!1;throw e}}async function Se(t,e){let r=(0,ge.inflate)(t);await(0,h.writeFile)(e,r),await(0,h.chmod)(e,"755")}async function be(t,e){await t.stream().pipeTo(N.WriteStream.toWeb((0,N.createWriteStream)(e,{encoding:"utf-8"})))}function X(t){return t!=null&&typeof t=="object"&&"code"in t&&t.code==="ENOENT"}async function we(t){try{return await(0,h.readFile)(t,{encoding:"utf-8"})}catch(e){if(X(e))return null;throw e}}async function Pe(t){await(0,h.mkdir)(t,{recursive:!0})}async function ve(t){try{return(await(0,h.readdir)(t,{withFileTypes:!0})).reduce((r,n)=>(n.isDirectory()&&!n.name.startsWith(".")&&r.push(n.name),r),[])}catch(e){if(X(e))return[];throw e}}var De=51214,Ee=51213,Ae=51215,v=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 g={connectionLimit:1,connectTimeout:0,database:"template1",maxIdleConnectionLifetime:0,password:"postgres",poolTimeout:0,socketTimeout:0,sslMode:"disable",username:"postgres"},vt=`postgres://${g.username}:${g.password}@localhost`,$e=new URLSearchParams({sslmode:g.sslMode}),Dt=new URLSearchParams({...Object.fromEntries($e.entries()),connection_limit:String(g.connectionLimit),connect_timeout:String(g.connectTimeout),max_idle_connection_lifetime:String(g.maxIdleConnectionLifetime),pool_timeout:String(g.poolTimeout),single_use_connections:"true",socket_timeout:String(g.socketTimeout)});async function Z(t,e){let r=t==="database"?e.databasePort:e.shadowDatabasePort;if(e.dryRun)return Re(t,e,{db:null,port:r,server:null});let{debug:n}=e,s=await(t==="shadow_database"?Et:_e)(e.pgliteDataDirPath,n);n&&s.onNotification((a,c)=>{console.debug(`[${t}][${a}] ${c}`)});let i=new Te.PGLiteSocketServer({db:s,debug:n,inspect:n,port:r});n&&(i.addEventListener("listening",a=>{let{detail:c}=a;console.debug(`[${t}] server listening on ${JSON.stringify(c)}`)}),i.addEventListener("connection",a=>{let{clientAddress:c,clientPort:m}=a.detail;console.debug(`[${t}] client connected from ${c}:${m}`)}),i.addEventListener("error",a=>{let{detail:c}=a;console.error(`[${t}] server error:`,c)}));try{await i.start()}catch(a){throw a instanceof Error&&"code"in a&&a.code==="EADDRINUSE"?new v(r,t):a}return Re(t,e,{db:s,port:r,server:i})}function Re(t,e,r){let{debug:n}=e,{db:o,port:s,server:i}=r||{};return n&&console.debug(`[${t}] server started on port ${s}`),{...g,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,$e),dump:async a=>{t==="shadow_database"||!o||await At({db:o,debug:n,destinationPath:a})},port:s,prismaORMConnectionString:Oe(s,Dt),terminalCommand:`PGPASSWORD=${g.password} PGSSLMODE=${g.sslMode} psql -h localhost -p ${s} -U ${g.username} -d ${g.database}`}}function Oe(t,e){return`${vt}:${t}/${g.database}?${e.toString()}`}async function _e(t,e){return await Y.PGlite.create({database:g.database,dataDir:t,debug:e?5:void 0,defaultDataTransferContainer:"file",relaxedDurability:!1,username:g.username})}async function Et(t,e){return await Y.PGlite.create({database:g.database,dataDir:"memory://",debug:e?5:void 0,defaultDataTransferContainer:"file",relaxedDurability:!1,username:g.username})}async function At(t){let{dataDir:e,db:r,debug:n,destinationPath:o}=t,s=r||await _e(e,n),{pgDump:i}=await import("@electric-sql/pglite-tools/pg_dump"),a=await i({args:["--quote-all-identifiers","--schema-only"],fileName:o?(0,xe.filename)(o):void 0,pg:s});return o?(n&&console.debug(`[DB] Dumping database to ${o}`),await be(a,o)):(n&&console.debug("[DB] Dumping database to memory"),await a.text())}var We=require("http"),ze=require("util"),Xe=require("@hono/node-server"),Ye=$(require("@prisma/get-platform"),1);function F(){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)}}var Ze=require("hono/logger"),ne=require("hono/tiny");var Ge=require("hono/tiny"),x=require("hono/validator");var f=require("valibot"),Rt=(0,f.object)({tags:(0,f.union)([(0,f.pipe)((0,f.array)((0,f.string)()),(0,f.minLength)(1)),(0,f.literal)("all")])});async function Ie(t){let{output:e,success:r}=(0,f.safeParse)(Rt,await t.req.json(),{abortEarly:!0});return r?e:t.text("Invalid input",400)}var ke=require("child_process"),He=require("events"),Be=require("fs/promises"),Le=require("path"),je=require("timers/promises");var Me=require("foreground-child/proxy-signals"),Ne=require("std-env");var{PRISMA_DEV_FORCE_ENGINE_BINARY_DOWNLOAD:Ot,PRISMA_DEV_FORCE_ENGINE_BINARY_PATH:Tt,PRISMA_DEV_FORCE_NETWORK_DELAY_MS:Ce}=Ne.process.env,T=class t{static#r=new Map;#e;#t;constructor(e){this.#e=e,this.#t=null}static async get(e){let{debug:r}=e,n=`${e.schemaHash}:${e.clientVersion}`;try{let o=t.#r.get(n);if(o)return o;let s=new t(e);return t.#r.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.#r.entries()).filter(([o])=>o!==e).map(async([o,s])=>{try{await s.stop()}finally{t.#r.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.#a(e,r,"commit")}async request(e,r){let{url:n}=await this.start(),o=this.#i(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 O.fromResponse(s);return await s.text()}async rollbackTransaction(e,r){return await this.#a(e,r,"rollback")}async startTransaction(e,r){let{url:n}=await this.start(),o=this.#i(r),s=await fetch(`${n}/transaction/start`,{body:JSON.stringify(e),headers:{...o,"Content-Type":"application/json"},method:"POST"});if(!s.ok)throw await O.fromResponse(s);return await s.json()}async start(){if(this.#t!=null)return await this.#t;let{promise:e,reject:r,resolve:n}=F();this.#t=e;let o=Tt||await this.#s();this.#e.debug&&console.debug("[Query Engine] spinning up at path...",o);let s=(0,ke.spawn)(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});(0,Me.proxySignals)(s),s.stderr.setEncoding("utf8"),s.stdout.setEncoding("utf8");let i=m=>{let S=m.split(`
|
|
1
|
+
"use strict";var dt=Object.create;var j=Object.defineProperty;var lt=Object.getOwnPropertyDescriptor;var pt=Object.getOwnPropertyNames;var mt=Object.getPrototypeOf,gt=Object.prototype.hasOwnProperty;var ft=(t,e)=>{for(var r in e)j(t,r,{get:e[r],enumerable:!0})},le=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of pt(e))!gt.call(t,o)&&o!==r&&j(t,o,{get:()=>e[o],enumerable:!(n=lt(e,o))||n.enumerable});return t};var $=(t,e,r)=>(r=t!=null?dt(mt(t)):{},le(e||!t||!t.__esModule?j(r,"default",{value:t,enumerable:!0}):r,t)),ht=t=>le(j({},"__esModule",{value:!0}),t);var Mt={};ft(Mt,{DEFAULT_DATABASE_PORT:()=>De,DEFAULT_SERVER_PORT:()=>Ee,DEFAULT_SHADOW_DATABASE_PORT:()=>Ae,PortNotAvailableError:()=>v,unstable_startServer:()=>jt});module.exports=ht(Mt);var P=require("hono/http-exception"),l=require("valibot"),pe=/^(postgres|postgresql):\/\//,yt=(0,l.pipe)((0,l.string)(),(0,l.parseJson)(),(0,l.object)({databaseUrl:(0,l.pipe)((0,l.string)(),(0,l.url)(),(0,l.regex)(pe)),name:(0,l.optional)((0,l.pipe)((0,l.string)(),(0,l.minLength)(1))),shadowDatabaseUrl:(0,l.pipe)((0,l.string)(),(0,l.url)(),(0,l.regex)(pe))}));function me(t){return Buffer.from(JSON.stringify(Object.fromEntries(Object.entries(t).sort(([[e],[r]])=>e.localeCompare(r)))),"utf8").toString("base64url")}function St(t){let e=Buffer.from(t,"base64url").toString("utf8"),{issues:r,output:n,success:o}=(0,l.safeParse)(yt,e,{abortEarly:!0});return o?[null,n]:[r]}var A=(t,e)=>{let{authorization:r}=t;if(!r)throw new P.HTTPException(401,{message:"Missing API Key"});let[n,o="",s]=r.split(" ");if(n!=="Bearer"||s)throw new P.HTTPException(401,{message:"Invalid API Key"});let[i,a]=St(o);if(i)throw new P.HTTPException(401,{message:"Invalid API Key",cause:i.join(", ")});let{databaseUrl:c,name:m,shadowDatabaseUrl:S}=a,{name:b}=e.get("serverState");if(!m)throw new P.HTTPException(401,{message:`Wrong API Key; The Prisma Dev server running at port ${e.get("port")} requires an API Key from a newer version of \`prisma dev\`. Check the "${b}" server's output for the updated \`DATABASE_URL\` value.`});if(m!==b)throw new P.HTTPException(401,{message:`Wrong API Key; The Prisma Dev server running at port ${e.get("port")} is named "${b}", but the API Key is for "${m}"`});let{hostname:y,port:L}=new URL(c),{port:J}=e.get("db"),{hostname:at,port:ct}=new URL(S),ut=e.get("shadowDBPort");if(y!=="localhost"||Number(L)!==J||at!=="localhost"||Number(ct)!==ut)throw new P.HTTPException(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}};var Y=require("@electric-sql/pglite"),Te=require("@electric-sql/pglite-socket"),xe=require("pathe/utils");var N=require("fs"),h=require("fs/promises");var p=$(require("path"),1),Q=$(require("os"),1),M=$(require("process"),1),w=Q.default.homedir(),W=Q.default.tmpdir(),{env:R}=M.default,bt=t=>{let e=p.default.join(w,"Library");return{data:p.default.join(e,"Application Support",t),config:p.default.join(e,"Preferences",t),cache:p.default.join(e,"Caches",t),log:p.default.join(e,"Logs",t),temp:p.default.join(W,t)}},wt=t=>{let e=R.APPDATA||p.default.join(w,"AppData","Roaming"),r=R.LOCALAPPDATA||p.default.join(w,"AppData","Local");return{data:p.default.join(r,t,"Data"),config:p.default.join(e,t,"Config"),cache:p.default.join(r,t,"Cache"),log:p.default.join(r,t,"Log"),temp:p.default.join(W,t)}},Pt=t=>{let e=p.default.basename(w);return{data:p.default.join(R.XDG_DATA_HOME||p.default.join(w,".local","share"),t),config:p.default.join(R.XDG_CONFIG_HOME||p.default.join(w,".config"),t),cache:p.default.join(R.XDG_CACHE_HOME||p.default.join(w,".cache"),t),log:p.default.join(R.XDG_STATE_HOME||p.default.join(w,".local","state"),t),temp:p.default.join(W,e,t)}};function z(t,{suffix:e="nodejs"}={}){if(typeof t!="string")throw new TypeError(`Expected a string, got ${typeof t}`);return e&&(t+=`-${e}`),M.default.platform==="darwin"?bt(t):M.default.platform==="win32"?wt(t):Pt(t)}var ge=require("pako"),fe=z("prisma-dev");function he(t,e){return`${fe.cache}/engine/${t}/${e}`}function _(t){return`${fe.data}/${t}`}async function ye(t){try{return await(0,h.access)(t,h.constants.F_OK),!0}catch(e){if(X(e))return!1;throw e}}async function Se(t,e){let r=(0,ge.inflate)(t);await(0,h.writeFile)(e,r),await(0,h.chmod)(e,"755")}async function be(t,e){await t.stream().pipeTo(N.WriteStream.toWeb((0,N.createWriteStream)(e,{encoding:"utf-8"})))}function X(t){return t!=null&&typeof t=="object"&&"code"in t&&t.code==="ENOENT"}async function we(t){try{return await(0,h.readFile)(t,{encoding:"utf-8"})}catch(e){if(X(e))return null;throw e}}async function Pe(t){await(0,h.mkdir)(t,{recursive:!0})}async function ve(t){try{return(await(0,h.readdir)(t,{withFileTypes:!0})).reduce((r,n)=>(n.isDirectory()&&!n.name.startsWith(".")&&r.push(n.name),r),[])}catch(e){if(X(e))return[];throw e}}var De=51214,Ee=51213,Ae=51215,v=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 g={connectionLimit:1,connectTimeout:0,database:"template1",maxIdleConnectionLifetime:0,password:"postgres",poolTimeout:0,socketTimeout:0,sslMode:"disable",username:"postgres"},vt=`postgres://${g.username}:${g.password}@localhost`,$e=new URLSearchParams({sslmode:g.sslMode}),Dt=new URLSearchParams({...Object.fromEntries($e.entries()),connection_limit:String(g.connectionLimit),connect_timeout:String(g.connectTimeout),max_idle_connection_lifetime:String(g.maxIdleConnectionLifetime),pool_timeout:String(g.poolTimeout),single_use_connections:"true",socket_timeout:String(g.socketTimeout)});async function Z(t,e){let r=t==="database"?e.databasePort:e.shadowDatabasePort;if(e.dryRun)return Re(t,e,{db:null,port:r,server:null});let{debug:n}=e,s=await(t==="shadow_database"?Et:_e)(e.pgliteDataDirPath,n);n&&s.onNotification((a,c)=>{console.debug(`[${t}][${a}] ${c}`)});let i=new Te.PGLiteSocketServer({db:s,debug:n,inspect:n,port:r});n&&(i.addEventListener("listening",a=>{let{detail:c}=a;console.debug(`[${t}] server listening on ${JSON.stringify(c)}`)}),i.addEventListener("connection",a=>{let{clientAddress:c,clientPort:m}=a.detail;console.debug(`[${t}] client connected from ${c}:${m}`)}),i.addEventListener("error",a=>{let{detail:c}=a;console.error(`[${t}] server error:`,c)}));try{await i.start()}catch(a){throw a instanceof Error&&"code"in a&&a.code==="EADDRINUSE"?new v(r,t):a}return Re(t,e,{db:s,port:r,server:i})}function Re(t,e,r){let{debug:n}=e,{db:o,port:s,server:i}=r||{};return n&&console.debug(`[${t}] server started on port ${s}`),{...g,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,$e),dump:async a=>{t==="shadow_database"||!o||await At({db:o,debug:n,destinationPath:a})},port:s,prismaORMConnectionString:Oe(s,Dt),terminalCommand:`PGPASSWORD=${g.password} PGSSLMODE=${g.sslMode} psql -h localhost -p ${s} -U ${g.username} -d ${g.database}`}}function Oe(t,e){return`${vt}:${t}/${g.database}?${e.toString()}`}async function _e(t,e){return await Y.PGlite.create({database:g.database,dataDir:t,debug:e?5:void 0,defaultDataTransferContainer:"file",relaxedDurability:!1,username:g.username})}async function Et(t,e){return await Y.PGlite.create({database:g.database,dataDir:"memory://",debug:e?5:void 0,defaultDataTransferContainer:"file",relaxedDurability:!1,username:g.username})}async function At(t){let{dataDir:e,db:r,debug:n,destinationPath:o}=t,s=r||await _e(e,n),{pgDump:i}=await import("@electric-sql/pglite-tools/pg_dump"),a=await i({args:["--quote-all-identifiers","--schema-only"],fileName:o?(0,xe.filename)(o):void 0,pg:s});return o?(n&&console.debug(`[DB] Dumping database to ${o}`),await be(a,o)):(n&&console.debug("[DB] Dumping database to memory"),await a.text())}var We=require("http"),ze=require("util"),Xe=require("@hono/node-server"),Ye=$(require("@prisma/get-platform"),1);function F(){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)}}var Ze=require("hono/logger"),ne=require("hono/tiny");var Ge=require("hono/tiny"),x=require("hono/validator");var f=require("valibot"),Rt=(0,f.object)({tags:(0,f.union)([(0,f.pipe)((0,f.array)((0,f.string)()),(0,f.minLength)(1)),(0,f.literal)("all")])});async function Ie(t){let{output:e,success:r}=(0,f.safeParse)(Rt,await t.req.json(),{abortEarly:!0});return r?e:t.text("Invalid input",400)}var ke=require("child_process"),He=require("events"),Be=require("fs/promises"),Le=require("path"),je=require("timers/promises");var Me=require("foreground-child/proxy-signals"),Ne=require("std-env");var{PRISMA_DEV_FORCE_ENGINE_BINARY_DOWNLOAD:Ot,PRISMA_DEV_FORCE_ENGINE_BINARY_PATH:Tt,PRISMA_DEV_FORCE_NETWORK_DELAY_MS:Ce}=Ne.process.env,T=class t{static#r=new Map;#e;#t;constructor(e){this.#e=e,this.#t=null}static async get(e){let{debug:r}=e,n=`${e.schemaHash}:${e.clientVersion}`;try{let o=t.#r.get(n);if(o)return o;let s=new t(e);return t.#r.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.#r.entries()).filter(([o])=>o!==e).map(async([o,s])=>{try{await s.stop()}finally{t.#r.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.#a(e,r,"commit")}async request(e,r){let{url:n}=await this.start(),o=this.#i(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 O.fromResponse(s);return await s.text()}async rollbackTransaction(e,r){return await this.#a(e,r,"rollback")}async startTransaction(e,r){let{url:n}=await this.start(),o=this.#i(r),s=await fetch(`${n}/transaction/start`,{body:JSON.stringify(e),headers:{...o,"Content-Type":"application/json"},method:"POST"});if(!s.ok)throw await O.fromResponse(s);return await s.json()}async start(){if(this.#t!=null)return await this.#t;let{promise:e,reject:r,resolve:n}=F();this.#t=e;let o=Tt||await this.#s();this.#e.debug&&console.debug("[Query Engine] spinning up at path...",o);let s=(0,ke.spawn)(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});(0,Me.proxySignals)(s),s.stderr.setEncoding("utf8"),s.stdout.setEncoding("utf8");let i=m=>{let S=m.split(`
|
|
2
2
|
`).find(J=>J.includes("Started query engine http server"));if(!S)return;s.stdout.removeListener("data",i);let{fields:b}=JSON.parse(S);if(b==null)return r(new Error(`Unexpected data during initialization, "fields" are missing: ${m}`));let{ip:y,port:L}=b;if(y==null||L==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.
|
|
3
3
|
Received data: ${m}`));n({childProcess:s,url:`http://${y}:${L}`})},a=m=>{this.#t=null,r(new I(String(m))),s.removeListener("exit",c),s.kill()};s.once("error",a);let c=(m,S)=>{this.#t=null,r(new I(`Query Engine exited with code ${m} and signal ${S}`))};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.#t}async stop(){if(this.#t==null)return;let{childProcess:e}=await this.#t;e.exitCode==null&&e.signalCode==null&&(this.#t=null,e.kill(),await(0,He.once)(e,"exit"))}async#s(){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=he(this.#e.clientVersion,e);this.#e.debug&&console.debug("[Query Engine] cache directory path",r),await(0,Be.mkdir)(r,{recursive:!0});let{platform:n}=this.#e.platform,o=n==="windows"?".exe":"",s=(0,Le.join)(r,`query-engine-${n}${o}`);return this.#e.debug&&console.debug("[Query Engine] binary path",s),(Ot==="1"||await ye(s)===!1)&&await this.#o({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#o(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}`);Ce&&await(0,je.setTimeout)(Number(Ce)),await Se(await a.arrayBuffer(),o),this.#e.debug&&console.debug("[Query Engine] downloaded and saved at",o)}#i(e){let r={};for(let[n,o]of Object.entries(e))o!=null&&(r[n]=o);return r}async#a(e,r,n){let{url:o}=await this.#t,s=this.#i(r),i=await fetch(`${o}/transaction/${e}/${n}`,{headers:{...s,"Content-Type":"application/json"},method:"POST"});if(!i.ok)throw await O.fromResponse(i);try{return await i.json()}catch{return{}}}};function U(t,e){return console.error(t),t instanceof I?e.json({EngineNotStarted:{reason:{EngineStartupError:{logs:[],msg:t.message}}}},500):t instanceof O?e.text(t.responseBody,t.statusCode):e.body(null,500)}var I=class extends Error{name="EngineStartError"},O=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)}};var ee=require("buffer"),V=new Map;async function te(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 Fe(t){let e=t.req.param("schemaHash"),r=V.get(e);return r==null?t.json({EngineNotStarted:{reason:"SchemaMissing"}},404):{schemaHash:e,schemas:r}}var xt=/datasource\s+db\s+\{\s*provider\s*=\s*"postgres(!?ql)?"\s+url\s*=\s*.+\s*\}/;async function Ue(t,e){let r=ee.Buffer.from(t,"base64").toString("utf8"),n=`datasource db {
|
|
4
4
|
provider = "postgresql"
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as I}from"./chunk-QUQSA6T7.js";import{a as M}from"./chunk-NYMMHKXT.js";import{a as _,c as j,d as B,i as Xe,j as Ye,k as Ze,l as L}from"./chunk-YMJGNP57.js";import{HTTPException as d}from"hono/http-exception";import{minLength as ce,object as pe,optional as ue,parseJson as me,pipe as P,regex as N,safeParse as le,string as E,url as q}from"valibot";var K=/^(postgres|postgresql):\/\//,de=P(E(),me(),pe({databaseUrl:P(E(),q(),N(K)),name:ue(P(E(),ce(1))),shadowDatabaseUrl:P(E(),q(),N(K))}));function U(n){return Buffer.from(JSON.stringify(Object.fromEntries(Object.entries(n).sort(([[e],[t]])=>e.localeCompare(t)))),"utf8").toString("base64url")}function ge(n){let e=Buffer.from(n,"base64url").toString("utf8"),{issues:t,output:r,success:o}=le(de,e,{abortEarly:!0});return o?[null,r]:[t]}var g=(n,e)=>{let{authorization:t}=n;if(!t)throw new d(401,{message:"Missing API Key"});let[r,o="",s]=t.split(" ");if(r!=="Bearer"||s)throw new d(401,{message:"Invalid API Key"});let[a,i]=ge(o);if(a)throw new d(401,{message:"Invalid API Key",cause:a.join(", ")});let{databaseUrl:p,name:c,shadowDatabaseUrl:l}=i,{name:m}=e.get("serverState");if(!c)throw new d(401,{message:`Wrong API Key; The server running at port ${e.get("port")} requires an API Key from a newer version of \`prisma dev\`. Check the "${m}" server's output for the updated \`DATABASE_URL\` value.`});if(c!==m)throw new d(401,{message:`Wrong API Key; The server running at port ${e.get("port")} is named "${m}", but the API Key is for "${c}"`});let{hostname:u,port:b}=new URL(p),{port:C}=e.get("db"),{hostname:se,port:ae}=new URL(l),ie=e.get("shadowDBPort");if(u!=="localhost"||Number(b)!==C||se!=="localhost"||Number(ae)!==ie)throw new d(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:i}};import{createServer as Qe}from"http";import{promisify as Fe}from"util";import{serve as ze}from"@hono/node-server";import Ge from"@prisma/get-platform";function R(){let n,e,t=new Promise((s,a)=>{n=s,e=a}),r=s=>{r=o=null,e(s)},o=s=>{o=r=null,n(s)};return{promise:t,reject:s=>r?.(s),resolve:s=>o?.(s)}}import{logger as Je}from"hono/logger";import{Hono as re}from"hono/tiny";import{Hono as Ne}from"hono/tiny";import{validator as w}from"hono/validator";import{array as he,literal as fe,minLength as ye,object as we,pipe as Se,safeParse as ve,string as be,union as Pe}from"valibot";var Ee=we({tags:Pe([Se(he(be()),ye(1)),fe("all")])});async function V(n){let{output:e,success:t}=ve(Ee,await n.req.json(),{abortEarly:!0});return t?e:n.text("Invalid input",400)}import{spawn as Re}from"child_process";import{once as Te}from"events";import{mkdir as Ae}from"fs/promises";import{join as Oe}from"path";import{setTimeout as He}from"timers/promises";import{proxySignals as Ce}from"foreground-child/proxy-signals";import{process as Ie}from"std-env";var{PRISMA_DEV_FORCE_ENGINE_BINARY_DOWNLOAD:xe,PRISMA_DEV_FORCE_ENGINE_BINARY_PATH:ke,PRISMA_DEV_FORCE_NETWORK_DELAY_MS:Q}=Ie.env,f=class n{static#n=new Map;#e;#t;constructor(e){this.#e=e,this.#t=null}static async get(e){let{debug:t}=e,r=`${e.schemaHash}:${e.clientVersion}`;try{let o=n.#n.get(r);if(o)return o;let s=new n(e);return n.#n.set(r,s),t&&console.debug("[Query Engine] starting...",e),await s.start(),t&&console.debug("[Query Engine] started!"),s}finally{n.stopAll(r)}}static async stopAll(e){let r=(await Promise.allSettled(Array.from(n.#n.entries()).filter(([o])=>o!==e).map(async([o,s])=>{try{await s.stop()}finally{n.#n.delete(o)}}))).filter(o=>o.status==="rejected").map(o=>o.reason);if(r.length>0)throw new AggregateError(r,"Failed to stop engines")}async commitTransaction(e,t){return await this.#o(e,t,"commit")}async request(e,t){let{url:r}=await this.start(),o=this.#r(t),s=await fetch(r,{body:typeof e=="string"?e:JSON.stringify(e),headers:{...o,"Content-Type":"application/json"},method:"POST"});if(!s.ok)throw await h.fromResponse(s);return await s.text()}async rollbackTransaction(e,t){return await this.#o(e,t,"rollback")}async startTransaction(e,t){let{url:r}=await this.start(),o=this.#r(t),s=await fetch(`${r}/transaction/start`,{body:JSON.stringify(e),headers:{...o,"Content-Type":"application/json"},method:"POST"});if(!s.ok)throw await h.fromResponse(s);return await s.json()}async start(){if(this.#t!=null)return await this.#t;let{promise:e,reject:t,resolve:r}=R();this.#t=e;let o=ke||await this.#s();this.#e.debug&&console.debug("[Query Engine] spinning up at path...",o);let s=Re(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});Ce(s),s.stderr.setEncoding("utf8"),s.stdout.setEncoding("utf8");let a=c=>{let l=c.split(`
|
|
1
|
+
import{a as I}from"./chunk-QUQSA6T7.js";import{a as M}from"./chunk-NYMMHKXT.js";import{a as _,c as j,d as B,i as Xe,j as Ye,k as Ze,l as L}from"./chunk-YMJGNP57.js";import{HTTPException as d}from"hono/http-exception";import{minLength as ce,object as pe,optional as ue,parseJson as me,pipe as P,regex as N,safeParse as le,string as E,url as q}from"valibot";var K=/^(postgres|postgresql):\/\//,de=P(E(),me(),pe({databaseUrl:P(E(),q(),N(K)),name:ue(P(E(),ce(1))),shadowDatabaseUrl:P(E(),q(),N(K))}));function U(n){return Buffer.from(JSON.stringify(Object.fromEntries(Object.entries(n).sort(([[e],[t]])=>e.localeCompare(t)))),"utf8").toString("base64url")}function ge(n){let e=Buffer.from(n,"base64url").toString("utf8"),{issues:t,output:r,success:o}=le(de,e,{abortEarly:!0});return o?[null,r]:[t]}var g=(n,e)=>{let{authorization:t}=n;if(!t)throw new d(401,{message:"Missing API Key"});let[r,o="",s]=t.split(" ");if(r!=="Bearer"||s)throw new d(401,{message:"Invalid API Key"});let[a,i]=ge(o);if(a)throw new d(401,{message:"Invalid API Key",cause:a.join(", ")});let{databaseUrl:p,name:c,shadowDatabaseUrl:l}=i,{name:m}=e.get("serverState");if(!c)throw new d(401,{message:`Wrong API Key; The Prisma Dev server running at port ${e.get("port")} requires an API Key from a newer version of \`prisma dev\`. Check the "${m}" server's output for the updated \`DATABASE_URL\` value.`});if(c!==m)throw new d(401,{message:`Wrong API Key; The Prisma Dev server running at port ${e.get("port")} is named "${m}", but the API Key is for "${c}"`});let{hostname:u,port:b}=new URL(p),{port:C}=e.get("db"),{hostname:se,port:ae}=new URL(l),ie=e.get("shadowDBPort");if(u!=="localhost"||Number(b)!==C||se!=="localhost"||Number(ae)!==ie)throw new d(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:i}};import{createServer as Qe}from"http";import{promisify as Fe}from"util";import{serve as ze}from"@hono/node-server";import Ge from"@prisma/get-platform";function R(){let n,e,t=new Promise((s,a)=>{n=s,e=a}),r=s=>{r=o=null,e(s)},o=s=>{o=r=null,n(s)};return{promise:t,reject:s=>r?.(s),resolve:s=>o?.(s)}}import{logger as Je}from"hono/logger";import{Hono as re}from"hono/tiny";import{Hono as Ne}from"hono/tiny";import{validator as w}from"hono/validator";import{array as he,literal as fe,minLength as ye,object as we,pipe as Se,safeParse as ve,string as be,union as Pe}from"valibot";var Ee=we({tags:Pe([Se(he(be()),ye(1)),fe("all")])});async function V(n){let{output:e,success:t}=ve(Ee,await n.req.json(),{abortEarly:!0});return t?e:n.text("Invalid input",400)}import{spawn as Re}from"child_process";import{once as Te}from"events";import{mkdir as Ae}from"fs/promises";import{join as Oe}from"path";import{setTimeout as He}from"timers/promises";import{proxySignals as Ce}from"foreground-child/proxy-signals";import{process as Ie}from"std-env";var{PRISMA_DEV_FORCE_ENGINE_BINARY_DOWNLOAD:xe,PRISMA_DEV_FORCE_ENGINE_BINARY_PATH:ke,PRISMA_DEV_FORCE_NETWORK_DELAY_MS:Q}=Ie.env,f=class n{static#n=new Map;#e;#t;constructor(e){this.#e=e,this.#t=null}static async get(e){let{debug:t}=e,r=`${e.schemaHash}:${e.clientVersion}`;try{let o=n.#n.get(r);if(o)return o;let s=new n(e);return n.#n.set(r,s),t&&console.debug("[Query Engine] starting...",e),await s.start(),t&&console.debug("[Query Engine] started!"),s}finally{n.stopAll(r)}}static async stopAll(e){let r=(await Promise.allSettled(Array.from(n.#n.entries()).filter(([o])=>o!==e).map(async([o,s])=>{try{await s.stop()}finally{n.#n.delete(o)}}))).filter(o=>o.status==="rejected").map(o=>o.reason);if(r.length>0)throw new AggregateError(r,"Failed to stop engines")}async commitTransaction(e,t){return await this.#o(e,t,"commit")}async request(e,t){let{url:r}=await this.start(),o=this.#r(t),s=await fetch(r,{body:typeof e=="string"?e:JSON.stringify(e),headers:{...o,"Content-Type":"application/json"},method:"POST"});if(!s.ok)throw await h.fromResponse(s);return await s.text()}async rollbackTransaction(e,t){return await this.#o(e,t,"rollback")}async startTransaction(e,t){let{url:r}=await this.start(),o=this.#r(t),s=await fetch(`${r}/transaction/start`,{body:JSON.stringify(e),headers:{...o,"Content-Type":"application/json"},method:"POST"});if(!s.ok)throw await h.fromResponse(s);return await s.json()}async start(){if(this.#t!=null)return await this.#t;let{promise:e,reject:t,resolve:r}=R();this.#t=e;let o=ke||await this.#s();this.#e.debug&&console.debug("[Query Engine] spinning up at path...",o);let s=Re(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});Ce(s),s.stderr.setEncoding("utf8"),s.stdout.setEncoding("utf8");let a=c=>{let l=c.split(`
|
|
2
2
|
`).find(C=>C.includes("Started query engine http server"));if(!l)return;s.stdout.removeListener("data",a);let{fields:m}=JSON.parse(l);if(m==null)return t(new Error(`Unexpected data during initialization, "fields" are missing: ${c}`));let{ip:u,port:b}=m;if(u==null||b==null)return t(new Error(`This version of query-engine is not compatible with minippg, "ip" and "port" are missing in the startup log entry.
|
|
3
3
|
Received data: ${c}`));r({childProcess:s,url:`http://${u}:${b}`})},i=c=>{this.#t=null,t(new y(String(c))),s.removeListener("exit",p),s.kill()};s.once("error",i);let p=(c,l)=>{this.#t=null,t(new y(`Query Engine exited with code ${c} and signal ${l}`))};return s.once("exit",p),s.stdout.on("data",a),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.#t}async stop(){if(this.#t==null)return;let{childProcess:e}=await this.#t;e.exitCode==null&&e.signalCode==null&&(this.#t=null,e.kill(),await Te(e,"exit"))}async#s(){this.#e.debug&&console.debug("[Query Engine] getting engine commit hash...");let e=await this.#a();this.#e.debug&&console.debug("[Query Engine] got engine commit hash",e);let t=_(this.#e.clientVersion,e);this.#e.debug&&console.debug("[Query Engine] cache directory path",t),await Ae(t,{recursive:!0});let{platform:r}=this.#e.platform,o=r==="windows"?".exe":"",s=Oe(t,`query-engine-${r}${o}`);return this.#e.debug&&console.debug("[Query Engine] binary path",s),(xe==="1"||await j(s)===!1)&&await this.#i({commitHash:e,extension:o,engineBinaryPath:s}),s}async#a(){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 r=(await e.json()).devDependencies?.["@prisma/engines-version"];if(!r)throw new Error("Couldn't find engines version in package.json");let o=r.split(".").at(-1);if(!o)throw new Error("Couldn't find commit hash in engines version");return o}async#i(e){let{commitHash:t,extension:r,engineBinaryPath:o}=e,{binaryTarget:s}=this.#e.platform,a=`https://binaries.prisma.sh/all_commits/${t}/${s}/query-engine${r}.gz`;this.#e.debug&&console.debug("[Query Engine] downloading engine from url",a);let i=await fetch(a);if(!i.ok)throw new Error(`Couldn't download engine. URL: ${a}, status code: ${i.status}`);Q&&await He(Number(Q)),await B(await i.arrayBuffer(),o),this.#e.debug&&console.debug("[Query Engine] downloaded and saved at",o)}#r(e){let t={};for(let[r,o]of Object.entries(e))o!=null&&(t[r]=o);return t}async#o(e,t,r){let{url:o}=await this.#t,s=this.#r(t),a=await fetch(`${o}/transaction/${e}/${r}`,{headers:{...s,"Content-Type":"application/json"},method:"POST"});if(!a.ok)throw await h.fromResponse(a);try{return await a.json()}catch{return{}}}};function T(n,e){return console.error(n),n instanceof y?e.json({EngineNotStarted:{reason:{EngineStartupError:{logs:[],msg:n.message}}}},500):n instanceof h?e.text(n.responseBody,n.statusCode):e.body(null,500)}var y=class extends Error{name="EngineStartError"},h=class n extends Error{constructor(t,r,o){super(`${t}: Query Engine response status ${r}, body: ${o}`);this.action=t;this.statusCode=r;this.responseBody=o}name="EngineHttpError";static async fromResponse(t){let r=new URL(t.url),o=await t.text();return new n(r.pathname,t.status,o)}};import{Buffer as F}from"buffer";var A=new Map;async function x(n){let t=new TextEncoder().encode(n),r=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(r)).map(a=>a.toString(16).padStart(2,"0")).join("")}function z(n){let e=n.req.param("schemaHash"),t=A.get(e);return t==null?n.json({EngineNotStarted:{reason:"SchemaMissing"}},404):{schemaHash:e,schemas:t}}var $e=/datasource\s+db\s+\{\s*provider\s*=\s*"postgres(!?ql)?"\s+url\s*=\s*.+\s*\}/;async function G(n,e){let t=F.from(n,"base64").toString("utf8"),r=`datasource db {
|
|
4
4
|
provider = "postgresql"
|