Skip to content

OpfsRepackedFS

Defined in: packages/pgwasm/src/opfs/opfs-repacked-fs.ts:26

The pgwasm filesystem adapter owned by createOpfsPgwasm.

Direct construction is unsupported. The factory retains this adapter so it can close all four handles when host initialization or shutdown fails.

readonly debug: boolean

Defined in: packages/pgwasm/src/fs/base-filesystem.ts:81

BaseFilesystem.debug

get description(): FilesystemDescription

Defined in: packages/pgwasm/src/opfs/opfs-repacked-fs.ts:37

An OPFS-repacked store: its data directory outlives the page.

FilesystemDescription

BaseFilesystem.description


get recentSyscallErrors(): readonly SyscallError[]

Defined in: packages/pgwasm/src/fs/base-filesystem.ts:98

The most recent failed filesystem calls reported to Postgres (up to 50), oldest first.

readonly SyscallError[]

BaseFilesystem.recentSyscallErrors

chmod(path, mode): void

Defined in: packages/pgwasm/src/opfs/opfs-repacked-fs.ts:66

string

number

void

BaseFilesystem.chmod


close(fd): void

Defined in: packages/pgwasm/src/opfs/opfs-repacked-fs.ts:70

number

void

BaseFilesystem.close


closeFs(): Promise<void>

Defined in: packages/pgwasm/src/opfs/opfs-repacked-fs.ts:62

Release everything the filesystem holds. Called when the database closes.

Promise<void>

BaseFilesystem.closeFs


fstat(fd): FsStats

Defined in: packages/pgwasm/src/opfs/opfs-repacked-fs.ts:74

number

FsStats

BaseFilesystem.fstat


initialSyncFs(): Promise<void>

Defined in: packages/pgwasm/src/opfs/opfs-repacked-fs.ts:41

Called once when the build mounts the filesystem, before anything reads it.

Promise<void>

BaseFilesystem.initialSyncFs


lstat(path): FsStats

Defined in: packages/pgwasm/src/opfs/opfs-repacked-fs.ts:78

string

FsStats

BaseFilesystem.lstat


mkdir(path, options?): void

Defined in: packages/pgwasm/src/opfs/opfs-repacked-fs.ts:82

string

number

boolean

void

BaseFilesystem.mkdir


open(path, flags?, mode?): number

Defined in: packages/pgwasm/src/opfs/opfs-repacked-fs.ts:90

string

string = "r+"

number = 0o100666

number

BaseFilesystem.open


read(fd, buffer, offset, length, position): number

Defined in: packages/pgwasm/src/opfs/opfs-repacked-fs.ts:98

Read into buffer[offset, offset + length) from position; returns the bytes read.

number

Uint8Array

number

number

number

number

BaseFilesystem.read


readdir(path): string[]

Defined in: packages/pgwasm/src/opfs/opfs-repacked-fs.ts:94

string

string[]

BaseFilesystem.readdir


recordSyscallError(op, path, errno, message): void

Defined in: packages/pgwasm/src/fs/base-filesystem.ts:103

Record a failed call. The build’s mount calls this where it turns a thrown error into an errno.

string

string

number

string

void

BaseFilesystem.recordSyscallError


rename(oldPath, newPath): void

Defined in: packages/pgwasm/src/opfs/opfs-repacked-fs.ts:102

string

string

void

BaseFilesystem.rename


rmdir(path): void

Defined in: packages/pgwasm/src/opfs/opfs-repacked-fs.ts:106

string

void

BaseFilesystem.rmdir


strictSync(): void

Defined in: packages/pgwasm/src/opfs/opfs-repacked-fs.ts:53

Stabilize every preceding data and metadata operation in strict order.

void


syncToFs(relaxedDurability?): Promise<void>

Defined in: packages/pgwasm/src/opfs/opfs-repacked-fs.ts:45

Make everything written so far durable. relaxed is pgwasm’s background persist.

boolean = false

Promise<void>

BaseFilesystem.syncToFs


truncate(path, length): void

Defined in: packages/pgwasm/src/opfs/opfs-repacked-fs.ts:110

string

number

void

BaseFilesystem.truncate


unlink(path): void

Defined in: packages/pgwasm/src/opfs/opfs-repacked-fs.ts:114

string

void

BaseFilesystem.unlink


utimes(path, atime, mtime): void

Defined in: packages/pgwasm/src/opfs/opfs-repacked-fs.ts:118

string

number

number

void

BaseFilesystem.utimes


write(fd, buffer, offset, length, position): number

Defined in: packages/pgwasm/src/opfs/opfs-repacked-fs.ts:135

Write buffer[offset, offset + length) at position; returns the bytes written.

number

Uint8Array

number

number

number

number

BaseFilesystem.write


writeFile(path, data, options?): void

Defined in: packages/pgwasm/src/opfs/opfs-repacked-fs.ts:122

string

string | Uint8Array<ArrayBufferLike>

string

string

number

void

BaseFilesystem.writeFile