@prisma/dev 0.0.0-dev.202601192209 → 0.0.0-dev.202603231356
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/accelerate-HWGEFOM5.js +11 -0
- package/dist/chunk-62DM64XC.js +1 -0
- package/dist/chunk-CC3P7GPW.js +3 -0
- package/dist/{chunk-ITQ6ILGR.js → chunk-DWY47FQV.js} +1 -1
- package/dist/{chunk-7NDL3ECU.js → chunk-TF5C7XJX.js} +1 -1
- package/dist/chunk-X3G665AK.js +1 -0
- package/dist/chunk-X7AUCZJT.js +1 -0
- package/dist/chunk-YL6J3L2T.js +100 -0
- package/dist/daemon.cjs +114 -5
- package/dist/daemon.d.cts +10 -4
- package/dist/daemon.d.ts +10 -4
- package/dist/daemon.js +1 -1
- package/dist/db.cjs +100 -1
- package/dist/db.d.cts +33 -2
- package/dist/db.d.ts +33 -2
- package/dist/db.js +1 -1
- package/dist/index.cjs +114 -5
- package/dist/index.d.cts +59 -11
- package/dist/index.d.ts +59 -11
- package/dist/index.js +1 -1
- package/dist/runtime-assets/amcheck.tar.gz +0 -0
- package/dist/runtime-assets/bloom.tar.gz +0 -0
- package/dist/runtime-assets/btree_gin.tar.gz +0 -0
- package/dist/runtime-assets/btree_gist.tar.gz +0 -0
- package/dist/runtime-assets/citext.tar.gz +0 -0
- package/dist/runtime-assets/cube.tar.gz +0 -0
- package/dist/runtime-assets/dict_int.tar.gz +0 -0
- package/dist/runtime-assets/dict_xsyn.tar.gz +0 -0
- package/dist/runtime-assets/earthdistance.tar.gz +0 -0
- package/dist/runtime-assets/file_fdw.tar.gz +0 -0
- package/dist/runtime-assets/fuzzystrmatch.tar.gz +0 -0
- package/dist/runtime-assets/hstore.tar.gz +0 -0
- package/dist/runtime-assets/initdb.wasm +0 -0
- package/dist/runtime-assets/intarray.tar.gz +0 -0
- package/dist/runtime-assets/isn.tar.gz +0 -0
- package/dist/runtime-assets/lo.tar.gz +0 -0
- package/dist/runtime-assets/ltree.tar.gz +0 -0
- package/dist/runtime-assets/pageinspect.tar.gz +0 -0
- package/dist/runtime-assets/pg_buffercache.tar.gz +0 -0
- package/dist/runtime-assets/pg_freespacemap.tar.gz +0 -0
- package/dist/runtime-assets/pg_surgery.tar.gz +0 -0
- package/dist/runtime-assets/pg_trgm.tar.gz +0 -0
- package/dist/runtime-assets/pg_visibility.tar.gz +0 -0
- package/dist/runtime-assets/pg_walinspect.tar.gz +0 -0
- package/dist/runtime-assets/pglite.data +0 -0
- package/dist/runtime-assets/pglite.wasm +0 -0
- package/dist/runtime-assets/seg.tar.gz +0 -0
- package/dist/runtime-assets/tablefunc.tar.gz +0 -0
- package/dist/runtime-assets/tcn.tar.gz +0 -0
- package/dist/runtime-assets/tsm_system_rows.tar.gz +0 -0
- package/dist/runtime-assets/tsm_system_time.tar.gz +0 -0
- package/dist/runtime-assets/unaccent.tar.gz +0 -0
- package/dist/runtime-assets/uuid-ossp.tar.gz +0 -0
- package/dist/runtime-assets/vector.tar.gz +0 -0
- package/dist/runtime-assets-manifest.bun.js +77 -0
- package/dist/runtime-assets.cjs +1 -0
- package/dist/runtime-assets.d.cts +26 -0
- package/dist/runtime-assets.d.ts +26 -0
- package/dist/runtime-assets.js +1 -0
- package/dist/state-DTMxyzXf.d.cts +235 -0
- package/dist/state-DTMxyzXf.d.ts +235 -0
- package/dist/state.cjs +3 -3
- package/dist/state.d.cts +2 -216
- package/dist/state.d.ts +2 -216
- package/dist/state.js +1 -1
- package/package.json +14 -11
- package/dist/accelerate-EEKAFGN3.js +0 -1
- package/dist/chunk-LKYVOPH3.js +0 -3
- package/dist/chunk-OTI5SWIV.js +0 -1
- package/dist/chunk-RJ42AYBU.js +0 -1
- package/dist/chunk-XMKRRRGB.js +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,57 @@
|
|
|
1
|
-
import { Exports, ServerOptions } from './state.js';
|
|
2
|
-
export { ServerAlreadyRunningError } from './state.js';
|
|
3
|
-
import { DBServerPurpose } from './db.js';
|
|
1
|
+
import { a as Exports, E as ExperimentalStreams, S as ServerOptions } from './state-DTMxyzXf.js';
|
|
2
|
+
export { b as ServerAlreadyRunningError } from './state-DTMxyzXf.js';
|
|
3
|
+
import { WalEvent, DBServerPurpose } from './db.js';
|
|
4
|
+
export { CopiedPrismaDevRuntimeAsset, PrismaDevRuntimeAsset, copyPrismaDevRuntimeAssets, getPrismaDevRuntimeAssetManifest } from './runtime-assets.js';
|
|
4
5
|
import 'valibot';
|
|
5
6
|
import '@electric-sql/pglite';
|
|
6
7
|
|
|
8
|
+
/**
|
|
9
|
+
* A readonly batch of WAL events emitted together.
|
|
10
|
+
*
|
|
11
|
+
* @experimental This API may change without notice.
|
|
12
|
+
*/
|
|
13
|
+
type ExperimentalWalEventBatch = readonly WalEvent[];
|
|
14
|
+
/**
|
|
15
|
+
* Callback invoked when a batch of WAL events is available.
|
|
16
|
+
*
|
|
17
|
+
* @experimental This API may change without notice.
|
|
18
|
+
*/
|
|
19
|
+
type ExperimentalWalEventCallback = (events: ExperimentalWalEventBatch) => void;
|
|
20
|
+
/**
|
|
21
|
+
* The experimental public WAL event API returned from `startPrismaDevServer()`.
|
|
22
|
+
*
|
|
23
|
+
* @experimental This API may change without notice.
|
|
24
|
+
*/
|
|
25
|
+
interface ExperimentalWalEvents {
|
|
26
|
+
/**
|
|
27
|
+
* Subscribe to WAL event batches. The returned function unsubscribes the callback.
|
|
28
|
+
*/
|
|
29
|
+
subscribe(callback: ExperimentalWalEventCallback): () => void;
|
|
30
|
+
/**
|
|
31
|
+
* Create an async iterator that yields WAL event batches as they arrive.
|
|
32
|
+
*/
|
|
33
|
+
stream(): AsyncIterableIterator<ExperimentalWalEventBatch>;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Experimental capabilities exposed on the public programmatic server.
|
|
37
|
+
*
|
|
38
|
+
* @experimental This API may change without notice.
|
|
39
|
+
*/
|
|
40
|
+
interface ExperimentalServerFeatures {
|
|
41
|
+
readonly streams: ExperimentalStreams;
|
|
42
|
+
readonly wal: ExperimentalWalEvents;
|
|
43
|
+
}
|
|
44
|
+
interface ProgrammaticServer extends Exports {
|
|
45
|
+
close(): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Experimental capabilities that may change without notice.
|
|
48
|
+
*
|
|
49
|
+
* @experimental
|
|
50
|
+
*/
|
|
51
|
+
experimental: ExperimentalServerFeatures;
|
|
52
|
+
name: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
7
55
|
declare const DEFAULT_DATABASE_PORT = 51214;
|
|
8
56
|
declare const DEFAULT_SERVER_PORT = 51213;
|
|
9
57
|
declare const DEFAULT_SHADOW_DATABASE_PORT = 51215;
|
|
@@ -14,20 +62,20 @@ declare class PortNotAvailableError extends Error {
|
|
|
14
62
|
constructor(port: number);
|
|
15
63
|
}
|
|
16
64
|
|
|
17
|
-
|
|
18
|
-
close(): Promise<void>;
|
|
19
|
-
name: string;
|
|
20
|
-
}
|
|
21
|
-
type ReadonlyServer = Omit<Server, "close">;
|
|
65
|
+
type ReadonlyServer = Omit<ProgrammaticServer, "close">;
|
|
22
66
|
/**
|
|
23
67
|
* Starts a `prisma dev` server instance programmatically.
|
|
24
68
|
*
|
|
25
69
|
* DO NOT USE IN PRODUCTION. This is only intended for development and testing purposes.
|
|
70
|
+
*
|
|
71
|
+
* The returned server also includes experimental capabilities under `server.experimental`,
|
|
72
|
+
* including WAL event subscriptions at `server.experimental.wal` and the
|
|
73
|
+
* colocated Prisma Streams endpoint metadata at `server.experimental.streams`.
|
|
26
74
|
*/
|
|
27
|
-
declare function startPrismaDevServer(options?: ServerOptions): Promise<
|
|
75
|
+
declare function startPrismaDevServer(options?: ServerOptions): Promise<ProgrammaticServer>;
|
|
28
76
|
/**
|
|
29
77
|
* @deprecated use {@link startPrismaDevServer} instead.
|
|
30
78
|
*/
|
|
31
|
-
declare function unstable_startServer(options?: ServerOptions): Promise<
|
|
79
|
+
declare function unstable_startServer(options?: ServerOptions): Promise<ProgrammaticServer>;
|
|
32
80
|
|
|
33
|
-
export { DEFAULT_DATABASE_PORT, DEFAULT_SERVER_PORT, DEFAULT_SHADOW_DATABASE_PORT, type PortAssignableService, PortNotAvailableError, type ReadonlyServer, type Server, ServerOptions, startPrismaDevServer, unstable_startServer };
|
|
81
|
+
export { DEFAULT_DATABASE_PORT, DEFAULT_SERVER_PORT, DEFAULT_SHADOW_DATABASE_PORT, type ExperimentalServerFeatures, ExperimentalStreams, WalEvent as ExperimentalWalEvent, type ExperimentalWalEventBatch, type ExperimentalWalEvents, type PortAssignableService, PortNotAvailableError, type ReadonlyServer, type ProgrammaticServer as Server, ServerOptions, startPrismaDevServer, unstable_startServer };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as h,b as i}from"./chunk-X7AUCZJT.js";import"./chunk-YL6J3L2T.js";import{a as e,b as f}from"./chunk-62DM64XC.js";import{k as g}from"./chunk-CC3P7GPW.js";import{a,b,c,g as d}from"./chunk-X3G665AK.js";import"./chunk-TF5C7XJX.js";import"./chunk-DWY47FQV.js";export{a as DEFAULT_DATABASE_PORT,b as DEFAULT_SERVER_PORT,c as DEFAULT_SHADOW_DATABASE_PORT,d as PortNotAvailableError,g as ServerAlreadyRunningError,e as copyPrismaDevRuntimeAssets,f as getPrismaDevRuntimeAssetManifest,h as startPrismaDevServer,i as unstable_startServer};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import {
|
|
2
|
+
registerBundledPGliteRuntimeAssetSources,
|
|
3
|
+
resolveBundledRuntimeAssetSource,
|
|
4
|
+
} from "./runtime-assets.js";
|
|
5
|
+
import initdbWasmAsset from "./runtime-assets/initdb.wasm";
|
|
6
|
+
import fsBundleAsset from "./runtime-assets/pglite.data";
|
|
7
|
+
import wasmModuleAsset from "./runtime-assets/pglite.wasm";
|
|
8
|
+
import amcheckAsset from "./runtime-assets/amcheck.tar.gz";
|
|
9
|
+
import bloomAsset from "./runtime-assets/bloom.tar.gz";
|
|
10
|
+
import btree_ginAsset from "./runtime-assets/btree_gin.tar.gz";
|
|
11
|
+
import btree_gistAsset from "./runtime-assets/btree_gist.tar.gz";
|
|
12
|
+
import citextAsset from "./runtime-assets/citext.tar.gz";
|
|
13
|
+
import cubeAsset from "./runtime-assets/cube.tar.gz";
|
|
14
|
+
import dict_intAsset from "./runtime-assets/dict_int.tar.gz";
|
|
15
|
+
import dict_xsynAsset from "./runtime-assets/dict_xsyn.tar.gz";
|
|
16
|
+
import earthdistanceAsset from "./runtime-assets/earthdistance.tar.gz";
|
|
17
|
+
import file_fdwAsset from "./runtime-assets/file_fdw.tar.gz";
|
|
18
|
+
import fuzzystrmatchAsset from "./runtime-assets/fuzzystrmatch.tar.gz";
|
|
19
|
+
import hstoreAsset from "./runtime-assets/hstore.tar.gz";
|
|
20
|
+
import intarrayAsset from "./runtime-assets/intarray.tar.gz";
|
|
21
|
+
import isnAsset from "./runtime-assets/isn.tar.gz";
|
|
22
|
+
import loAsset from "./runtime-assets/lo.tar.gz";
|
|
23
|
+
import ltreeAsset from "./runtime-assets/ltree.tar.gz";
|
|
24
|
+
import pageinspectAsset from "./runtime-assets/pageinspect.tar.gz";
|
|
25
|
+
import pg_buffercacheAsset from "./runtime-assets/pg_buffercache.tar.gz";
|
|
26
|
+
import pg_freespacemapAsset from "./runtime-assets/pg_freespacemap.tar.gz";
|
|
27
|
+
import pg_surgeryAsset from "./runtime-assets/pg_surgery.tar.gz";
|
|
28
|
+
import pg_trgmAsset from "./runtime-assets/pg_trgm.tar.gz";
|
|
29
|
+
import pg_visibilityAsset from "./runtime-assets/pg_visibility.tar.gz";
|
|
30
|
+
import pg_walinspectAsset from "./runtime-assets/pg_walinspect.tar.gz";
|
|
31
|
+
import segAsset from "./runtime-assets/seg.tar.gz";
|
|
32
|
+
import tablefuncAsset from "./runtime-assets/tablefunc.tar.gz";
|
|
33
|
+
import tcnAsset from "./runtime-assets/tcn.tar.gz";
|
|
34
|
+
import tsm_system_rowsAsset from "./runtime-assets/tsm_system_rows.tar.gz";
|
|
35
|
+
import tsm_system_timeAsset from "./runtime-assets/tsm_system_time.tar.gz";
|
|
36
|
+
import unaccentAsset from "./runtime-assets/unaccent.tar.gz";
|
|
37
|
+
import uuid_osspAsset from "./runtime-assets/uuid-ossp.tar.gz";
|
|
38
|
+
import vectorAsset from "./runtime-assets/vector.tar.gz";
|
|
39
|
+
|
|
40
|
+
registerBundledPGliteRuntimeAssetSources({
|
|
41
|
+
fsBundle: resolveBundledRuntimeAssetSource(fsBundleAsset, import.meta.url),
|
|
42
|
+
initdbWasm: resolveBundledRuntimeAssetSource(initdbWasmAsset, import.meta.url),
|
|
43
|
+
wasmModule: resolveBundledRuntimeAssetSource(wasmModuleAsset, import.meta.url),
|
|
44
|
+
extensions: {
|
|
45
|
+
"amcheck": resolveBundledRuntimeAssetSource(amcheckAsset, import.meta.url),
|
|
46
|
+
"bloom": resolveBundledRuntimeAssetSource(bloomAsset, import.meta.url),
|
|
47
|
+
"btree_gin": resolveBundledRuntimeAssetSource(btree_ginAsset, import.meta.url),
|
|
48
|
+
"btree_gist": resolveBundledRuntimeAssetSource(btree_gistAsset, import.meta.url),
|
|
49
|
+
"citext": resolveBundledRuntimeAssetSource(citextAsset, import.meta.url),
|
|
50
|
+
"cube": resolveBundledRuntimeAssetSource(cubeAsset, import.meta.url),
|
|
51
|
+
"dict_int": resolveBundledRuntimeAssetSource(dict_intAsset, import.meta.url),
|
|
52
|
+
"dict_xsyn": resolveBundledRuntimeAssetSource(dict_xsynAsset, import.meta.url),
|
|
53
|
+
"earthdistance": resolveBundledRuntimeAssetSource(earthdistanceAsset, import.meta.url),
|
|
54
|
+
"file_fdw": resolveBundledRuntimeAssetSource(file_fdwAsset, import.meta.url),
|
|
55
|
+
"fuzzystrmatch": resolveBundledRuntimeAssetSource(fuzzystrmatchAsset, import.meta.url),
|
|
56
|
+
"hstore": resolveBundledRuntimeAssetSource(hstoreAsset, import.meta.url),
|
|
57
|
+
"intarray": resolveBundledRuntimeAssetSource(intarrayAsset, import.meta.url),
|
|
58
|
+
"isn": resolveBundledRuntimeAssetSource(isnAsset, import.meta.url),
|
|
59
|
+
"lo": resolveBundledRuntimeAssetSource(loAsset, import.meta.url),
|
|
60
|
+
"ltree": resolveBundledRuntimeAssetSource(ltreeAsset, import.meta.url),
|
|
61
|
+
"pageinspect": resolveBundledRuntimeAssetSource(pageinspectAsset, import.meta.url),
|
|
62
|
+
"pg_buffercache": resolveBundledRuntimeAssetSource(pg_buffercacheAsset, import.meta.url),
|
|
63
|
+
"pg_freespacemap": resolveBundledRuntimeAssetSource(pg_freespacemapAsset, import.meta.url),
|
|
64
|
+
"pg_surgery": resolveBundledRuntimeAssetSource(pg_surgeryAsset, import.meta.url),
|
|
65
|
+
"pg_trgm": resolveBundledRuntimeAssetSource(pg_trgmAsset, import.meta.url),
|
|
66
|
+
"pg_visibility": resolveBundledRuntimeAssetSource(pg_visibilityAsset, import.meta.url),
|
|
67
|
+
"pg_walinspect": resolveBundledRuntimeAssetSource(pg_walinspectAsset, import.meta.url),
|
|
68
|
+
"seg": resolveBundledRuntimeAssetSource(segAsset, import.meta.url),
|
|
69
|
+
"tablefunc": resolveBundledRuntimeAssetSource(tablefuncAsset, import.meta.url),
|
|
70
|
+
"tcn": resolveBundledRuntimeAssetSource(tcnAsset, import.meta.url),
|
|
71
|
+
"tsm_system_rows": resolveBundledRuntimeAssetSource(tsm_system_rowsAsset, import.meta.url),
|
|
72
|
+
"tsm_system_time": resolveBundledRuntimeAssetSource(tsm_system_timeAsset, import.meta.url),
|
|
73
|
+
"unaccent": resolveBundledRuntimeAssetSource(unaccentAsset, import.meta.url),
|
|
74
|
+
"uuid_ossp": resolveBundledRuntimeAssetSource(uuid_osspAsset, import.meta.url),
|
|
75
|
+
"vector": resolveBundledRuntimeAssetSource(vectorAsset, import.meta.url),
|
|
76
|
+
},
|
|
77
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var z=Object.create;var m=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty;var D=(e,t)=>{for(var n in t)m(e,n,{get:t[n],enumerable:!0})},p=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of v(t))!T.call(e,i)&&i!==n&&m(e,i,{get:()=>t[i],enumerable:!(s=E(t,i))||s.enumerable});return e};var G=(e,t,n)=>(n=e!=null?z(x(e)):{},p(t||!e||!e.__esModule?m(n,"default",{value:e,enumerable:!0}):n,e)),I=e=>p(m({},"__esModule",{value:!0}),e);var H={};D(H,{copyPrismaDevRuntimeAssets:()=>O,getPGliteRuntimeAssets:()=>W,getPrismaDevRuntimeAssetManifest:()=>L,registerBundledPGliteRuntimeAssetSources:()=>C,resolveBundledRuntimeAssetSource:()=>u});module.exports=I(H);var N=()=>typeof document>"u"?new URL(`file:${__filename}`).href:document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"?document.currentScript.src:new URL("main.js",document.baseURI).href,l=N();var o=require("fs"),a=require("fs/promises"),w=require("module"),A=require("path"),r=require("url"),k=(0,w.createRequire)(l),M=["initdb.wasm","pglite.data","pglite.wasm"],P={amcheck:"amcheck.tar.gz",bloom:"bloom.tar.gz",btree_gin:"btree_gin.tar.gz",btree_gist:"btree_gist.tar.gz",citext:"citext.tar.gz",cube:"cube.tar.gz",dict_int:"dict_int.tar.gz",dict_xsyn:"dict_xsyn.tar.gz",earthdistance:"earthdistance.tar.gz",file_fdw:"file_fdw.tar.gz",fuzzystrmatch:"fuzzystrmatch.tar.gz",hstore:"hstore.tar.gz",intarray:"intarray.tar.gz",isn:"isn.tar.gz",lo:"lo.tar.gz",ltree:"ltree.tar.gz",pageinspect:"pageinspect.tar.gz",pg_buffercache:"pg_buffercache.tar.gz",pg_freespacemap:"pg_freespacemap.tar.gz",pg_surgery:"pg_surgery.tar.gz",pg_trgm:"pg_trgm.tar.gz",pg_visibility:"pg_visibility.tar.gz",pg_walinspect:"pg_walinspect.tar.gz",seg:"seg.tar.gz",tablefunc:"tablefunc.tar.gz",tcn:"tcn.tar.gz",tsm_system_rows:"tsm_system_rows.tar.gz",tsm_system_time:"tsm_system_time.tar.gz",unaccent:"unaccent.tar.gz",uuid_ossp:"uuid-ossp.tar.gz",vector:"vector.tar.gz"},U=[...M.map(e=>({fileName:e,kind:"core",name:e})),...Object.entries(P).map(([e,t])=>({fileName:t,kind:"extension",name:e}))],d=new Map,h=Symbol.for("@prisma/dev/bundled-pglite-runtime-asset-sources"),c=null;async function O(e){let t=f(e),n=(0,r.fileURLToPath)(t);await(0,a.mkdir)(n,{recursive:!0});let s=[];for(let i of L()){let g=new URL(i.fileName,t),R=(0,r.fileURLToPath)(g);await(0,a.copyFile)(i.sourcePath,R),s.push({...i,destinationPath:R})}return s}function L(){let e=_();return U.map(t=>({...t,sourcePath:(0,r.fileURLToPath)(new URL(t.fileName,e))}))}async function W(){await K();let e=S();if(e)return await J(e),await F(e);let t=q(),n=t.href,s=d.get(n);return s||(s=j(t),d.set(n,s)),await s}function C(e){let t=globalThis;t[h]={extensions:Object.fromEntries(Object.entries(e.extensions).map(([n,s])=>[n,u(s)])),fsBundle:u(e.fsBundle),initdbWasm:u(e.initdbWasm),wasmModule:u(e.wasmModule)}}function u(e,t=l){return e instanceof URL?e:/^(?:https?:|data:|file:)/.test(e)?new URL(e):e.startsWith("/")||/^[a-zA-Z]:[\\/]/.test(e)?(0,r.pathToFileURL)(e):new URL(e,t)}async function F(e){let t=`bundled:${e.wasmModule.href}:${e.fsBundle.href}`,n=d.get(t);return n||(n=$(e),d.set(t,n)),await n}async function j(e){let[t,n]=await Promise.all([(0,a.readFile)(new URL("pglite.data",e)),(0,a.readFile)(new URL("pglite.wasm",e))]),s=B();return{extensions:Object.fromEntries(Object.entries(P).map(([i,g])=>[i,new URL(g,e)])),fsBundle:new Blob([Uint8Array.from(t)]),wasmModule:await s.compile(n)}}async function $(e){let[t,n]=await Promise.all([b(e.fsBundle),b(e.wasmModule)]),s=B();return{extensions:e.extensions,fsBundle:new Blob([Uint8Array.from(t)]),wasmModule:await s.compile(n)}}async function J(e){if(e.initdbWasm.protocol!=="file:")return;let t=new URL("initdb.wasm",f(new URL("./",e.initdbWasm))),n=(0,r.fileURLToPath)(t);(0,o.existsSync)(n)||await(0,a.copyFile)((0,r.fileURLToPath)(e.initdbWasm),n)}function f(e){return e instanceof URL?y(e):y((0,r.pathToFileURL)(e))}function y(e){return e.href.endsWith("/")?e:new URL(`${e.href}/`)}function _(){let e=k.resolve("@electric-sql/pglite");return f((0,A.dirname)(e))}function q(){let e=f(new URL("./",l));if(Y(e))return e;if(X())return _();throw new Error("Unable to locate PGlite runtime assets. If you bundled @prisma/dev, copy them next to the bundle with copyPrismaDevRuntimeAssets().")}function Y(e){return U.every(t=>(0,o.existsSync)((0,r.fileURLToPath)(new URL(t.fileName,e))))}function S(){return globalThis[h]??null}async function K(){!Z()||S()||(c||(c=import("./runtime-assets-manifest.bun.js").then(()=>{}).catch(e=>{throw c=null,e})),await c)}function X(){let e=(0,r.fileURLToPath)(new URL("../package.json",l));if(!(0,o.existsSync)(e))return!1;try{return JSON.parse((0,o.readFileSync)(e,"utf8")).name==="@prisma/dev"}catch{return!1}}function Z(){return typeof globalThis.Bun<"u"}function B(){let e=globalThis.WebAssembly;if(!e)throw new Error("WebAssembly is not available in this runtime.");return e}async function b(e){if(e.protocol==="file:")return await(0,a.readFile)(e);let t=await fetch(e);if(!t.ok)throw new Error(`Failed to fetch runtime asset ${e.href}: ${t.status} ${t.statusText}`);return new Uint8Array(await t.arrayBuffer())}0&&(module.exports={copyPrismaDevRuntimeAssets,getPGliteRuntimeAssets,getPrismaDevRuntimeAssetManifest,registerBundledPGliteRuntimeAssetSources,resolveBundledRuntimeAssetSource});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
interface PGliteRuntimeAssets {
|
|
2
|
+
readonly extensions: Record<string, URL>;
|
|
3
|
+
readonly fsBundle: Blob;
|
|
4
|
+
readonly wasmModule: unknown;
|
|
5
|
+
}
|
|
6
|
+
interface PrismaDevRuntimeAsset {
|
|
7
|
+
readonly fileName: string;
|
|
8
|
+
readonly kind: "core" | "extension";
|
|
9
|
+
readonly name: string;
|
|
10
|
+
readonly sourcePath: string;
|
|
11
|
+
}
|
|
12
|
+
interface CopiedPrismaDevRuntimeAsset extends PrismaDevRuntimeAsset {
|
|
13
|
+
readonly destinationPath: string;
|
|
14
|
+
}
|
|
15
|
+
declare function copyPrismaDevRuntimeAssets(destinationDir: string | URL): Promise<CopiedPrismaDevRuntimeAsset[]>;
|
|
16
|
+
declare function getPrismaDevRuntimeAssetManifest(): readonly PrismaDevRuntimeAsset[];
|
|
17
|
+
declare function getPGliteRuntimeAssets(): Promise<PGliteRuntimeAssets>;
|
|
18
|
+
declare function registerBundledPGliteRuntimeAssetSources(sources: {
|
|
19
|
+
extensions: Record<string, string | URL>;
|
|
20
|
+
fsBundle: string | URL;
|
|
21
|
+
initdbWasm: string | URL;
|
|
22
|
+
wasmModule: string | URL;
|
|
23
|
+
}): void;
|
|
24
|
+
declare function resolveBundledRuntimeAssetSource(source: string | URL, baseURL?: string): URL;
|
|
25
|
+
|
|
26
|
+
export { type CopiedPrismaDevRuntimeAsset, type PrismaDevRuntimeAsset, copyPrismaDevRuntimeAssets, getPGliteRuntimeAssets, getPrismaDevRuntimeAssetManifest, registerBundledPGliteRuntimeAssetSources, resolveBundledRuntimeAssetSource };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
interface PGliteRuntimeAssets {
|
|
2
|
+
readonly extensions: Record<string, URL>;
|
|
3
|
+
readonly fsBundle: Blob;
|
|
4
|
+
readonly wasmModule: unknown;
|
|
5
|
+
}
|
|
6
|
+
interface PrismaDevRuntimeAsset {
|
|
7
|
+
readonly fileName: string;
|
|
8
|
+
readonly kind: "core" | "extension";
|
|
9
|
+
readonly name: string;
|
|
10
|
+
readonly sourcePath: string;
|
|
11
|
+
}
|
|
12
|
+
interface CopiedPrismaDevRuntimeAsset extends PrismaDevRuntimeAsset {
|
|
13
|
+
readonly destinationPath: string;
|
|
14
|
+
}
|
|
15
|
+
declare function copyPrismaDevRuntimeAssets(destinationDir: string | URL): Promise<CopiedPrismaDevRuntimeAsset[]>;
|
|
16
|
+
declare function getPrismaDevRuntimeAssetManifest(): readonly PrismaDevRuntimeAsset[];
|
|
17
|
+
declare function getPGliteRuntimeAssets(): Promise<PGliteRuntimeAssets>;
|
|
18
|
+
declare function registerBundledPGliteRuntimeAssetSources(sources: {
|
|
19
|
+
extensions: Record<string, string | URL>;
|
|
20
|
+
fsBundle: string | URL;
|
|
21
|
+
initdbWasm: string | URL;
|
|
22
|
+
wasmModule: string | URL;
|
|
23
|
+
}): void;
|
|
24
|
+
declare function resolveBundledRuntimeAssetSource(source: string | URL, baseURL?: string): URL;
|
|
25
|
+
|
|
26
|
+
export { type CopiedPrismaDevRuntimeAsset, type PrismaDevRuntimeAsset, copyPrismaDevRuntimeAssets, getPGliteRuntimeAssets, getPrismaDevRuntimeAssetManifest, registerBundledPGliteRuntimeAssetSources, resolveBundledRuntimeAssetSource };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e}from"./chunk-62DM64XC.js";export{a as copyPrismaDevRuntimeAssets,c as getPGliteRuntimeAssets,b as getPrismaDevRuntimeAssetManifest,d as registerBundledPGliteRuntimeAssetSources,e as resolveBundledRuntimeAssetSource};
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import * as valibot from 'valibot';
|
|
2
|
+
import { InferOutput } from 'valibot';
|
|
3
|
+
|
|
4
|
+
interface ExperimentalStreams {
|
|
5
|
+
readonly serverUrl: string;
|
|
6
|
+
readonly sqlitePath: string;
|
|
7
|
+
readonly streamName: string;
|
|
8
|
+
readonly url: string;
|
|
9
|
+
}
|
|
10
|
+
interface ExperimentalServerMetadata {
|
|
11
|
+
readonly streams?: ExperimentalStreams;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare const exportsSchema: valibot.ObjectSchema<{
|
|
15
|
+
readonly database: valibot.ObjectSchema<{
|
|
16
|
+
readonly connectionString: valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>;
|
|
17
|
+
readonly prismaORMConnectionString: valibot.OptionalSchema<valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>, undefined>;
|
|
18
|
+
readonly terminalCommand: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
|
|
19
|
+
}, undefined>;
|
|
20
|
+
readonly http: valibot.ObjectSchema<{
|
|
21
|
+
readonly url: valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>;
|
|
22
|
+
}, undefined>;
|
|
23
|
+
readonly ppg: valibot.ObjectSchema<{
|
|
24
|
+
readonly url: valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>;
|
|
25
|
+
}, undefined>;
|
|
26
|
+
readonly shadowDatabase: valibot.ObjectSchema<{
|
|
27
|
+
readonly connectionString: valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>;
|
|
28
|
+
readonly prismaORMConnectionString: valibot.OptionalSchema<valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>, undefined>;
|
|
29
|
+
readonly terminalCommand: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
|
|
30
|
+
}, undefined>;
|
|
31
|
+
}, undefined>;
|
|
32
|
+
type Exports = InferOutput<typeof exportsSchema>;
|
|
33
|
+
declare const serverDumpV1Schema: valibot.ObjectSchema<{
|
|
34
|
+
readonly databasePort: valibot.SchemaWithPipe<readonly [valibot.NumberSchema<undefined>, valibot.IntegerAction<number, undefined>, valibot.MinValueAction<number, 1, undefined>]>;
|
|
35
|
+
readonly experimental: valibot.OptionalSchema<valibot.ObjectSchema<{
|
|
36
|
+
readonly streams: valibot.OptionalSchema<valibot.ObjectSchema<{
|
|
37
|
+
readonly serverUrl: valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>;
|
|
38
|
+
readonly sqlitePath: valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.MinLengthAction<string, 1, undefined>]>;
|
|
39
|
+
readonly streamName: valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.MinLengthAction<string, 1, undefined>]>;
|
|
40
|
+
readonly url: valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>;
|
|
41
|
+
}, undefined>, undefined>;
|
|
42
|
+
}, undefined>, undefined>;
|
|
43
|
+
readonly exports: valibot.OptionalSchema<valibot.ObjectSchema<{
|
|
44
|
+
readonly database: valibot.ObjectSchema<{
|
|
45
|
+
readonly connectionString: valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>;
|
|
46
|
+
readonly prismaORMConnectionString: valibot.OptionalSchema<valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>, undefined>;
|
|
47
|
+
readonly terminalCommand: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
|
|
48
|
+
}, undefined>;
|
|
49
|
+
readonly http: valibot.ObjectSchema<{
|
|
50
|
+
readonly url: valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>;
|
|
51
|
+
}, undefined>;
|
|
52
|
+
readonly ppg: valibot.ObjectSchema<{
|
|
53
|
+
readonly url: valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>;
|
|
54
|
+
}, undefined>;
|
|
55
|
+
readonly shadowDatabase: valibot.ObjectSchema<{
|
|
56
|
+
readonly connectionString: valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>;
|
|
57
|
+
readonly prismaORMConnectionString: valibot.OptionalSchema<valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.UrlAction<string, undefined>]>, undefined>;
|
|
58
|
+
readonly terminalCommand: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
|
|
59
|
+
}, undefined>;
|
|
60
|
+
}, undefined>, undefined>;
|
|
61
|
+
readonly name: valibot.SchemaWithPipe<readonly [valibot.StringSchema<undefined>, valibot.MinLengthAction<string, 1, undefined>]>;
|
|
62
|
+
readonly pid: valibot.OptionalSchema<valibot.SchemaWithPipe<readonly [valibot.NumberSchema<undefined>, valibot.IntegerAction<number, undefined>, valibot.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
63
|
+
readonly port: valibot.SchemaWithPipe<readonly [valibot.NumberSchema<undefined>, valibot.IntegerAction<number, undefined>, valibot.MinValueAction<number, 1, undefined>]>;
|
|
64
|
+
readonly shadowDatabasePort: valibot.SchemaWithPipe<readonly [valibot.NumberSchema<undefined>, valibot.IntegerAction<number, undefined>, valibot.MinValueAction<number, 1, undefined>]>;
|
|
65
|
+
readonly version: valibot.LiteralSchema<"1", undefined>;
|
|
66
|
+
}, undefined>;
|
|
67
|
+
type ServerDumpV1 = InferOutput<typeof serverDumpV1Schema>;
|
|
68
|
+
interface ServerOptions {
|
|
69
|
+
/**
|
|
70
|
+
* Connection timeout in milliseconds for pending database connections.
|
|
71
|
+
*
|
|
72
|
+
* This option is currently not enforced by the multiplexed
|
|
73
|
+
* `@electric-sql/pglite-socket` server used by `@prisma/dev`.
|
|
74
|
+
* It is kept for API compatibility until upstream exposes a queue-timeout
|
|
75
|
+
* equivalent again.
|
|
76
|
+
*
|
|
77
|
+
* Default is 1 minute (60,000 milliseconds).
|
|
78
|
+
*/
|
|
79
|
+
databaseConnectTimeoutMillis?: number;
|
|
80
|
+
/**
|
|
81
|
+
* Idle timeout in milliseconds for open database connections.
|
|
82
|
+
*
|
|
83
|
+
* Re-starts ticking after each message received on a connection. When exceeded,
|
|
84
|
+
* that client connection is closed by the socket server.
|
|
85
|
+
*
|
|
86
|
+
* Is not applied by default.
|
|
87
|
+
*
|
|
88
|
+
* Use it with caution, as it may lead to unexpected disconnections. Best used
|
|
89
|
+
* with a pool client that can handle disconnections gracefully.
|
|
90
|
+
*
|
|
91
|
+
* Set it if you suffer from client hanging indefinitely as the active connection
|
|
92
|
+
* remain open forever.
|
|
93
|
+
*/
|
|
94
|
+
databaseIdleTimeoutMillis?: number;
|
|
95
|
+
/**
|
|
96
|
+
* The port the database server will listen on.
|
|
97
|
+
*
|
|
98
|
+
* Defaults to `51214`.
|
|
99
|
+
*
|
|
100
|
+
* An error is thrown if the port is already in use.
|
|
101
|
+
*/
|
|
102
|
+
databasePort?: number;
|
|
103
|
+
/**
|
|
104
|
+
* Whether to enable debug logging.
|
|
105
|
+
*
|
|
106
|
+
* Defaults to `false`.
|
|
107
|
+
*/
|
|
108
|
+
debug?: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Whether to run the server in dry run mode.
|
|
111
|
+
*
|
|
112
|
+
* Defaults to `false`.
|
|
113
|
+
*/
|
|
114
|
+
dryRun?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* The name of the server.
|
|
117
|
+
*
|
|
118
|
+
* Defaults to `default`.
|
|
119
|
+
*/
|
|
120
|
+
name?: string;
|
|
121
|
+
/**
|
|
122
|
+
* The persistence mode of the server.
|
|
123
|
+
*
|
|
124
|
+
* Default is `stateless`.
|
|
125
|
+
*/
|
|
126
|
+
persistenceMode?: PersistenceMode;
|
|
127
|
+
/**
|
|
128
|
+
* The port the server will listen on.
|
|
129
|
+
*
|
|
130
|
+
* Defaults to `51213`.
|
|
131
|
+
*
|
|
132
|
+
* An error is thrown if the port is already in use.
|
|
133
|
+
*/
|
|
134
|
+
port?: number;
|
|
135
|
+
/**
|
|
136
|
+
* Connection timeout in milliseconds for pending shadow database connections.
|
|
137
|
+
*
|
|
138
|
+
* Default is {@link databaseConnectTimeoutMillis}.
|
|
139
|
+
*/
|
|
140
|
+
shadowDatabaseConnectTimeoutMillis?: number;
|
|
141
|
+
/**
|
|
142
|
+
* Idle timeout in milliseconds for active shadow database connections.
|
|
143
|
+
*
|
|
144
|
+
* Default is {@link databaseIdleTimeoutMillis}.
|
|
145
|
+
*/
|
|
146
|
+
shadowDatabaseIdleTimeoutMillis?: number;
|
|
147
|
+
/**
|
|
148
|
+
* The port the shadow database server will listen on.
|
|
149
|
+
*
|
|
150
|
+
* Defaults to `51215`.
|
|
151
|
+
*
|
|
152
|
+
* An error is thrown if the port is already in use.
|
|
153
|
+
*/
|
|
154
|
+
shadowDatabasePort?: number;
|
|
155
|
+
}
|
|
156
|
+
type ResolvedServerOptions = Required<ServerOptions>;
|
|
157
|
+
type PersistenceMode = "stateless" | "stateful";
|
|
158
|
+
interface ScanOptions {
|
|
159
|
+
debug?: boolean;
|
|
160
|
+
globs?: string[];
|
|
161
|
+
onlyMetadata?: boolean;
|
|
162
|
+
}
|
|
163
|
+
declare const PRIVATE_INITIALIZE_SYMBOL: unique symbol;
|
|
164
|
+
declare abstract class ServerState implements ResolvedServerOptions {
|
|
165
|
+
#private;
|
|
166
|
+
protected _databasePort: number;
|
|
167
|
+
readonly databaseConnectTimeoutMillis: number;
|
|
168
|
+
readonly databaseIdleTimeoutMillis: number;
|
|
169
|
+
readonly debug: boolean;
|
|
170
|
+
readonly dryRun: boolean;
|
|
171
|
+
readonly name: string;
|
|
172
|
+
readonly persistenceMode: PersistenceMode;
|
|
173
|
+
readonly pid: number | undefined;
|
|
174
|
+
readonly shadowDatabaseConnectTimeoutMillis: number;
|
|
175
|
+
readonly shadowDatabaseIdleTimeoutMillis: number;
|
|
176
|
+
protected _port: number;
|
|
177
|
+
protected _shadowDatabasePort: number;
|
|
178
|
+
protected _streamsPort: number;
|
|
179
|
+
protected constructor(options: Omit<ServerOptions, "persistenceMode"> & {
|
|
180
|
+
persistenceMode: PersistenceMode;
|
|
181
|
+
pid?: number | undefined;
|
|
182
|
+
});
|
|
183
|
+
static createExclusively(options: ServerOptions | undefined): Promise<ServerState>;
|
|
184
|
+
static fromServerDump(options?: Pick<ServerOptions, "debug" | "name">): Promise<StatefulServerState | null>;
|
|
185
|
+
static scan(options?: ScanOptions): Promise<ServerStatusV1[]>;
|
|
186
|
+
abstract get databaseDumpPath(): string;
|
|
187
|
+
abstract get pgliteDataDirPath(): string;
|
|
188
|
+
abstract [PRIVATE_INITIALIZE_SYMBOL](): Promise<void>;
|
|
189
|
+
abstract close(): Promise<void>;
|
|
190
|
+
abstract writeServerDump(exports?: Exports, experimental?: ExperimentalServerMetadata): Promise<void>;
|
|
191
|
+
get databasePort(): number;
|
|
192
|
+
set databasePort(value: number);
|
|
193
|
+
get port(): number;
|
|
194
|
+
set port(value: number);
|
|
195
|
+
get shadowDatabasePort(): number;
|
|
196
|
+
get streamsPort(): number;
|
|
197
|
+
set shadowDatabasePort(value: number);
|
|
198
|
+
}
|
|
199
|
+
declare class StatefulServerState extends ServerState {
|
|
200
|
+
#private;
|
|
201
|
+
constructor(options: (Omit<ServerOptions, "persistenceMode"> & {
|
|
202
|
+
pid?: number | undefined;
|
|
203
|
+
serverDump?: ServerDumpV1;
|
|
204
|
+
}) | undefined);
|
|
205
|
+
static getServerDumpPath(dataDirPath: string): string;
|
|
206
|
+
get databaseDumpPath(): string;
|
|
207
|
+
get exports(): Exports | undefined;
|
|
208
|
+
get experimental(): ExperimentalServerMetadata | undefined;
|
|
209
|
+
get pgliteDataDirPath(): string;
|
|
210
|
+
[PRIVATE_INITIALIZE_SYMBOL](): Promise<void>;
|
|
211
|
+
close(): Promise<void>;
|
|
212
|
+
writeServerDump(exports?: Exports, experimental?: ExperimentalServerMetadata): Promise<void>;
|
|
213
|
+
}
|
|
214
|
+
interface ServerStatusV1 extends ServerDumpV1 {
|
|
215
|
+
status: "running" | "starting_up" | "not_running" | "no_such_server" | "unknown" | "error";
|
|
216
|
+
}
|
|
217
|
+
declare function deleteServer(nameOrStatus: string | ServerStatusV1, debug?: boolean): Promise<void>;
|
|
218
|
+
declare function getServerStatus(nameOrState: string | StatefulServerState, options?: ScanOptions): Promise<ServerStatusV1>;
|
|
219
|
+
declare function isServerRunning(server: ServerStatusV1): boolean;
|
|
220
|
+
declare function killServer(nameOrStatus: string | ServerStatusV1, debug?: boolean): Promise<boolean>;
|
|
221
|
+
/**
|
|
222
|
+
* @deprecated use `ServerAlreadyRunningError` instead. Will be removed in a future version.
|
|
223
|
+
*/
|
|
224
|
+
declare class ServerStateAlreadyExistsError extends Error {
|
|
225
|
+
name: string;
|
|
226
|
+
constructor(name: string);
|
|
227
|
+
}
|
|
228
|
+
declare class ServerAlreadyRunningError extends ServerStateAlreadyExistsError {
|
|
229
|
+
#private;
|
|
230
|
+
name: string;
|
|
231
|
+
constructor(server: ServerState);
|
|
232
|
+
get server(): Promise<ServerState | null>;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
export { type ExperimentalStreams as E, type PersistenceMode as P, type ResolvedServerOptions as R, type ServerOptions as S, type Exports as a, ServerAlreadyRunningError as b, ServerState as c, type ScanOptions as d, type ServerDumpV1 as e, ServerStateAlreadyExistsError as f, type ServerStatusV1 as g, deleteServer as h, getServerStatus as i, isServerRunning as j, killServer as k };
|