Aktueller Stand

This commit is contained in:
2026-01-23 01:33:35 +01:00
parent 082dc5e110
commit 2766dd12c5
10109 changed files with 1578841 additions and 77685 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
export { v as BaseFilesystem, G as ERRNO_CODES, E as EmscriptenBuiltinFilesystem, C as Filesystem, w as FsStats, A as FsType, z as PGDATA, W as WASM_PREFIX } from '../pglite-CntadC_p.cjs';

View File

@@ -0,0 +1 @@
export { v as BaseFilesystem, G as ERRNO_CODES, E as EmscriptenBuiltinFilesystem, C as Filesystem, w as FsStats, A as FsType, z as PGDATA, W as WASM_PREFIX } from '../pglite-CntadC_p.js';

View File

@@ -0,0 +1,2 @@
import{c as a,d as b,e as c,f as d,g as e}from"../chunk-VBDAOXYI.js";import"../chunk-QY3QWFKW.js";export{d as BaseFilesystem,e as ERRNO_CODES,c as EmscriptenBuiltinFilesystem,b as PGDATA,a as WASM_PREFIX};
//# sourceMappingURL=base.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,12 @@
import { E as EmscriptenBuiltinFilesystem, b as PGlite, c as PostgresMod } from '../pglite-CntadC_p.cjs';
declare class NodeFS extends EmscriptenBuiltinFilesystem {
protected rootDir: string;
constructor(dataDir: string);
init(pg: PGlite, opts: Partial<PostgresMod>): Promise<{
emscriptenOpts: Partial<PostgresMod>;
}>;
closeFs(): Promise<void>;
}
export { NodeFS };

View File

@@ -0,0 +1,12 @@
import { E as EmscriptenBuiltinFilesystem, b as PGlite, c as PostgresMod } from '../pglite-CntadC_p.js';
declare class NodeFS extends EmscriptenBuiltinFilesystem {
protected rootDir: string;
constructor(dataDir: string);
init(pg: PGlite, opts: Partial<PostgresMod>): Promise<{
emscriptenOpts: Partial<PostgresMod>;
}>;
closeFs(): Promise<void>;
}
export { NodeFS };

View File

@@ -0,0 +1,2 @@
import{d as i,e as p}from"../chunk-VBDAOXYI.js";import{j as n}from"../chunk-QY3QWFKW.js";n();import*as s from"fs";import*as o from"path";var m=class extends p{constructor(t){super(t),this.rootDir=o.resolve(t),s.existsSync(o.join(this.rootDir))||s.mkdirSync(this.rootDir)}async init(t,e){return this.pg=t,{emscriptenOpts:{...e,preRun:[...e.preRun||[],r=>{let c=r.FS.filesystems.NODEFS;r.FS.mkdir(i),r.FS.mount(c,{root:this.rootDir},i)}]}}}async closeFs(){this.pg.Module.FS.quit()}};export{m as NodeFS};
//# sourceMappingURL=nodefs.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/fs/nodefs.ts"],"sourcesContent":["import * as fs from 'fs'\nimport * as path from 'path'\nimport { EmscriptenBuiltinFilesystem, PGDATA } from './base.js'\nimport type { PostgresMod } from '../postgresMod.js'\nimport { PGlite } from '../pglite.js'\n\nexport class NodeFS extends EmscriptenBuiltinFilesystem {\n protected rootDir: string\n\n constructor(dataDir: string) {\n super(dataDir)\n this.rootDir = path.resolve(dataDir)\n if (!fs.existsSync(path.join(this.rootDir))) {\n fs.mkdirSync(this.rootDir)\n }\n }\n\n async init(pg: PGlite, opts: Partial<PostgresMod>) {\n this.pg = pg\n const options: Partial<PostgresMod> = {\n ...opts,\n preRun: [\n ...(opts.preRun || []),\n (mod: any) => {\n const nodefs = mod.FS.filesystems.NODEFS\n mod.FS.mkdir(PGDATA)\n mod.FS.mount(nodefs, { root: this.rootDir }, PGDATA)\n },\n ],\n }\n return { emscriptenOpts: options }\n }\n\n async closeFs(): Promise<void> {\n this.pg!.Module.FS.quit()\n }\n}\n"],"mappings":"yFAAAA,IAAA,UAAYC,MAAQ,KACpB,UAAYC,MAAU,OAKf,IAAMC,EAAN,cAAqBC,CAA4B,CAGtD,YAAYC,EAAiB,CAC3B,MAAMA,CAAO,EACb,KAAK,QAAe,UAAQA,CAAO,EAC3B,aAAgB,OAAK,KAAK,OAAO,CAAC,GACrC,YAAU,KAAK,OAAO,CAE7B,CAEA,MAAM,KAAKC,EAAYC,EAA4B,CACjD,YAAK,GAAKD,EAYH,CAAE,eAX6B,CACpC,GAAGC,EACH,OAAQ,CACN,GAAIA,EAAK,QAAU,CAAC,EACnBC,GAAa,CACZ,IAAMC,EAASD,EAAI,GAAG,YAAY,OAClCA,EAAI,GAAG,MAAME,CAAM,EACnBF,EAAI,GAAG,MAAMC,EAAQ,CAAE,KAAM,KAAK,OAAQ,EAAGC,CAAM,CACrD,CACF,CACF,CACiC,CACnC,CAEA,MAAM,SAAyB,CAC7B,KAAK,GAAI,OAAO,GAAG,KAAK,CAC1B,CACF","names":["init_esm_shims","fs","path","NodeFS","EmscriptenBuiltinFilesystem","dataDir","pg","opts","mod","nodefs","PGDATA"]}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,112 @@
import { v as BaseFilesystem, b as PGlite, c as PostgresMod, w as FsStats } from '../pglite-CntadC_p.cjs';
interface OpfsAhpOptions {
initialPoolSize?: number;
maintainedPoolSize?: number;
debug?: boolean;
}
interface FileSystemSyncAccessHandle {
close(): void;
flush(): void;
getSize(): number;
read(buffer: ArrayBuffer, options: {
at: number;
}): number;
truncate(newSize: number): void;
write(buffer: ArrayBuffer, options: {
at: number;
}): number;
}
interface State {
root: DirectoryNode;
pool: PoolFilenames;
}
type PoolFilenames = Array<string>;
interface WALEntry {
opp: string;
args: any[];
}
type NodeType = 'file' | 'directory';
interface BaseNode {
type: NodeType;
lastModified: number;
mode: number;
}
interface FileNode extends BaseNode {
type: 'file';
backingFilename: string;
}
interface DirectoryNode extends BaseNode {
type: 'directory';
children: {
[filename: string]: Node;
};
}
type Node = FileNode | DirectoryNode;
/**
* PGlite OPFS access handle pool filesystem.
* Opens a pool of sync access handles and then allocates them as needed.
*/
declare class OpfsAhpFS extends BaseFilesystem {
#private;
readonly dataDir: string;
readonly initialPoolSize: number;
readonly maintainedPoolSize: number;
state: State;
lastCheckpoint: number;
checkpointInterval: number;
poolCounter: number;
constructor(dataDir: string, { initialPoolSize, maintainedPoolSize, debug, }?: OpfsAhpOptions);
init(pg: PGlite, opts: Partial<PostgresMod>): Promise<{
emscriptenOpts: Partial<PostgresMod>;
}>;
syncToFs(relaxedDurability?: boolean): Promise<void>;
closeFs(): Promise<void>;
maintainPool(size?: number): Promise<void>;
_createPoolFileState(filename: string): void;
_deletePoolFileState(filename: string): void;
maybeCheckpointState(): Promise<void>;
checkpointState(): Promise<void>;
flush(): void;
chmod(path: string, mode: number): void;
_chmodState(path: string, mode: number): void;
close(fd: number): void;
fstat(fd: number): FsStats;
lstat(path: string): FsStats;
mkdir(path: string, options?: {
recursive?: boolean;
mode?: number;
}): void;
_mkdirState(path: string, options?: {
recursive?: boolean;
mode?: number;
}): void;
open(path: string, _flags?: string, _mode?: number): number;
readdir(path: string): string[];
read(fd: number, buffer: Uint8Array, // Buffer to read into
offset: number, // Offset in buffer to start writing to
length: number, // Number of bytes to read
position: number): number;
rename(oldPath: string, newPath: string): void;
_renameState(oldPath: string, newPath: string, doFileOps?: boolean): void;
rmdir(path: string): void;
_rmdirState(path: string): void;
truncate(path: string, len?: number): void;
unlink(path: string): void;
_unlinkState(path: string, doFileOps?: boolean): void;
utimes(path: string, atime: number, mtime: number): void;
_utimesState(path: string, _atime: number, mtime: number): void;
writeFile(path: string, data: string | Uint8Array, options?: {
encoding?: string;
mode?: number;
flag?: string;
}): void;
_createFileNodeState(path: string, node: FileNode): FileNode;
_setLastModifiedState(path: string, lastModified: number): void;
write(fd: number, buffer: Uint8Array, // Buffer to read from
offset: number, // Offset in buffer to start reading from
length: number, // Number of bytes to write
position: number): number;
}
export { type DirectoryNode, type FileNode, type FileSystemSyncAccessHandle, type Node, type NodeType, OpfsAhpFS, type OpfsAhpOptions, type PoolFilenames, type State, type WALEntry };

View File

@@ -0,0 +1,112 @@
import { v as BaseFilesystem, b as PGlite, c as PostgresMod, w as FsStats } from '../pglite-CntadC_p.js';
interface OpfsAhpOptions {
initialPoolSize?: number;
maintainedPoolSize?: number;
debug?: boolean;
}
interface FileSystemSyncAccessHandle {
close(): void;
flush(): void;
getSize(): number;
read(buffer: ArrayBuffer, options: {
at: number;
}): number;
truncate(newSize: number): void;
write(buffer: ArrayBuffer, options: {
at: number;
}): number;
}
interface State {
root: DirectoryNode;
pool: PoolFilenames;
}
type PoolFilenames = Array<string>;
interface WALEntry {
opp: string;
args: any[];
}
type NodeType = 'file' | 'directory';
interface BaseNode {
type: NodeType;
lastModified: number;
mode: number;
}
interface FileNode extends BaseNode {
type: 'file';
backingFilename: string;
}
interface DirectoryNode extends BaseNode {
type: 'directory';
children: {
[filename: string]: Node;
};
}
type Node = FileNode | DirectoryNode;
/**
* PGlite OPFS access handle pool filesystem.
* Opens a pool of sync access handles and then allocates them as needed.
*/
declare class OpfsAhpFS extends BaseFilesystem {
#private;
readonly dataDir: string;
readonly initialPoolSize: number;
readonly maintainedPoolSize: number;
state: State;
lastCheckpoint: number;
checkpointInterval: number;
poolCounter: number;
constructor(dataDir: string, { initialPoolSize, maintainedPoolSize, debug, }?: OpfsAhpOptions);
init(pg: PGlite, opts: Partial<PostgresMod>): Promise<{
emscriptenOpts: Partial<PostgresMod>;
}>;
syncToFs(relaxedDurability?: boolean): Promise<void>;
closeFs(): Promise<void>;
maintainPool(size?: number): Promise<void>;
_createPoolFileState(filename: string): void;
_deletePoolFileState(filename: string): void;
maybeCheckpointState(): Promise<void>;
checkpointState(): Promise<void>;
flush(): void;
chmod(path: string, mode: number): void;
_chmodState(path: string, mode: number): void;
close(fd: number): void;
fstat(fd: number): FsStats;
lstat(path: string): FsStats;
mkdir(path: string, options?: {
recursive?: boolean;
mode?: number;
}): void;
_mkdirState(path: string, options?: {
recursive?: boolean;
mode?: number;
}): void;
open(path: string, _flags?: string, _mode?: number): number;
readdir(path: string): string[];
read(fd: number, buffer: Uint8Array, // Buffer to read into
offset: number, // Offset in buffer to start writing to
length: number, // Number of bytes to read
position: number): number;
rename(oldPath: string, newPath: string): void;
_renameState(oldPath: string, newPath: string, doFileOps?: boolean): void;
rmdir(path: string): void;
_rmdirState(path: string): void;
truncate(path: string, len?: number): void;
unlink(path: string): void;
_unlinkState(path: string, doFileOps?: boolean): void;
utimes(path: string, atime: number, mtime: number): void;
_utimesState(path: string, _atime: number, mtime: number): void;
writeFile(path: string, data: string | Uint8Array, options?: {
encoding?: string;
mode?: number;
flag?: string;
}): void;
_createFileNodeState(path: string, node: FileNode): FileNode;
_setLastModifiedState(path: string, lastModified: number): void;
write(fd: number, buffer: Uint8Array, // Buffer to read from
offset: number, // Offset in buffer to start reading from
length: number, // Number of bytes to write
position: number): number;
}
export { type DirectoryNode, type FileNode, type FileSystemSyncAccessHandle, type Node, type NodeType, OpfsAhpFS, type OpfsAhpOptions, type PoolFilenames, type State, type WALEntry };

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long