@pgxsinkit/pgwasm-c 0.6.0-rc.1 → 0.6.0-rc.2
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/NOTICE +13 -13
- package/README.md +8 -2
- package/artefacts/amcheck.tar.gz +0 -0
- package/artefacts/initdb.wasm +0 -0
- package/artefacts/postgres.data +740 -692
- package/artefacts/postgres.js +1 -1
- package/artefacts/postgres.wasm +0 -0
- package/artefacts/prepopulated.tar.gz +0 -0
- package/dist/artefact-pins.d.ts +17 -17
- package/dist/artefacts.d.ts.map +1 -1
- package/dist/host/vfs-mount.d.ts.map +1 -1
- package/dist/index.js +39 -18
- package/dist/index.js.map +5 -5
- package/package.json +2 -2
- package/src/artefact-pins.ts +11 -11
- package/src/artefacts.ts +23 -4
- package/src/host/vfs-mount.ts +8 -1
package/src/artefact-pins.ts
CHANGED
|
@@ -12,25 +12,25 @@
|
|
|
12
12
|
/** The release the files are assets of. */
|
|
13
13
|
export const ARTEFACT_RELEASE = {
|
|
14
14
|
repository: "pgxsinkit/pgwasm-postgres",
|
|
15
|
-
tag: "19.0.0-rc.
|
|
16
|
-
name: "pgwasm-postgres 19.0.0-rc.
|
|
17
|
-
commit: "
|
|
18
|
-
upstream: { tag: "
|
|
15
|
+
tag: "19.0.0-rc.2",
|
|
16
|
+
name: "pgwasm-postgres 19.0.0-rc.2",
|
|
17
|
+
commit: "528131bf65a410e6a533a3cf67e69abe2a122842",
|
|
18
|
+
upstream: { tag: "REL_19_RC2", commit: "dffcca2e3c81178c64d4c1f44543a3507d0b7508" },
|
|
19
19
|
dataFormat: 2,
|
|
20
20
|
builderImage:
|
|
21
21
|
"ghcr.io/pgxsinkit/pgwasm-builder@sha256:cbb378a50de43cd2fbd8718b72ce4c7595ffe421148a3c32435906f096bc5130",
|
|
22
|
-
manifestSha256: "
|
|
22
|
+
manifestSha256: "aa13280c998ac707210025f77fdf0c1afd9f7970d6f11b03d70757cbf9006d3b",
|
|
23
23
|
} as const;
|
|
24
24
|
|
|
25
25
|
/** Every pinned file, by its name in `artefacts/` (the release asset of the same name). */
|
|
26
26
|
export const ARTEFACT_FILES = {
|
|
27
|
-
"amcheck.tar.gz": { bytes:
|
|
27
|
+
"amcheck.tar.gz": { bytes: 21906, sha256: "1af3d942e088a8a8317d46861b56603dd6fe38e5d9d7ae26e809efdf1f784f5d" },
|
|
28
28
|
"initdb.js": { bytes: 105130, sha256: "cf3fff4109879f3be1ba321f19b126c4f8d518d9909846927d3104b1ec0a8129" },
|
|
29
|
-
"initdb.wasm": { bytes: 308968, sha256: "
|
|
30
|
-
"postgres.data": { bytes:
|
|
31
|
-
"postgres.js": { bytes:
|
|
32
|
-
"postgres.wasm": { bytes:
|
|
33
|
-
"prepopulated.tar.gz": { bytes:
|
|
29
|
+
"initdb.wasm": { bytes: 308968, sha256: "2c9bb1c3ad3267b4ae5d21c1bc9ebfaf608ecfbb2e14e671ad4ed0a24657edb3" },
|
|
30
|
+
"postgres.data": { bytes: 6332734, sha256: "eaa28b912167539490fedb7f37ccecfd4d569919b16da7708b2aad62442bde98" },
|
|
31
|
+
"postgres.js": { bytes: 337357, sha256: "6c6c65b7fcbc3651f8bb38a4536216b186eb8cd57bca5fca1ce712a1fcc83009" },
|
|
32
|
+
"postgres.wasm": { bytes: 9483613, sha256: "9d3b5b288cd1e0dc5d7adcb4b7a17de0d6dd6f5545c1fa350b98f67f3ed15306" },
|
|
33
|
+
"prepopulated.tar.gz": { bytes: 4474382, sha256: "7f0c6af78341f4bbbd80030e2131a86ee19791864f192a82f5d4ad49ee7d969f" },
|
|
34
34
|
} as const;
|
|
35
35
|
|
|
36
36
|
export type ArtefactName = keyof typeof ARTEFACT_FILES;
|
package/src/artefacts.ts
CHANGED
|
@@ -12,14 +12,24 @@ import createInitdbModule from "../artefacts/initdb.js";
|
|
|
12
12
|
import createPostgresModule from "../artefacts/postgres.js";
|
|
13
13
|
import { ARTEFACT_FILES } from "./artefact-pins";
|
|
14
14
|
|
|
15
|
+
let postgresWasm: URL | undefined;
|
|
16
|
+
let fsBundle: URL | undefined;
|
|
17
|
+
let initdbWasm: URL | undefined;
|
|
18
|
+
|
|
15
19
|
/** The URLs of the files the C build loads, for fetching and compiling them ahead of a boot. */
|
|
16
20
|
export const cBuildArtefacts = {
|
|
17
21
|
/** The Postgres WebAssembly module. */
|
|
18
|
-
postgresWasm:
|
|
22
|
+
get postgresWasm(): URL {
|
|
23
|
+
return (postgresWasm ??= new URL("../artefacts/postgres.wasm", import.meta.url));
|
|
24
|
+
},
|
|
19
25
|
/** The filesystem bundle (share/, lib/, the ICU data) the Postgres module mounts. */
|
|
20
|
-
fsBundle:
|
|
26
|
+
get fsBundle(): URL {
|
|
27
|
+
return (fsBundle ??= new URL("../artefacts/postgres.data", import.meta.url));
|
|
28
|
+
},
|
|
21
29
|
/** The initdb WebAssembly module, used when a data directory is created. */
|
|
22
|
-
initdbWasm:
|
|
30
|
+
get initdbWasm(): URL {
|
|
31
|
+
return (initdbWasm ??= new URL("../artefacts/initdb.wasm", import.meta.url));
|
|
32
|
+
},
|
|
23
33
|
} as const;
|
|
24
34
|
|
|
25
35
|
/**
|
|
@@ -41,6 +51,15 @@ export interface CBuildArtefactSet {
|
|
|
41
51
|
export const pinnedCBuildArtefacts: CBuildArtefactSet = {
|
|
42
52
|
createPostgresModule,
|
|
43
53
|
createInitdbModule,
|
|
44
|
-
|
|
54
|
+
// Forward lazily: spreading cBuildArtefacts would invoke its getters during import.
|
|
55
|
+
get postgresWasm() {
|
|
56
|
+
return cBuildArtefacts.postgresWasm;
|
|
57
|
+
},
|
|
58
|
+
get fsBundle() {
|
|
59
|
+
return cBuildArtefacts.fsBundle;
|
|
60
|
+
},
|
|
61
|
+
get initdbWasm() {
|
|
62
|
+
return cBuildArtefacts.initdbWasm;
|
|
63
|
+
},
|
|
45
64
|
fsBundleBytes: ARTEFACT_FILES["postgres.data"].bytes,
|
|
46
65
|
};
|
package/src/host/vfs-mount.ts
CHANGED
|
@@ -10,6 +10,8 @@ interface NodeAttributes {
|
|
|
10
10
|
mode?: number;
|
|
11
11
|
size?: number;
|
|
12
12
|
timestamp?: number;
|
|
13
|
+
atime?: number;
|
|
14
|
+
mtime?: number;
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
/** A Uint8Array over exactly the bytes of `buffer` (Emscripten hands the heap as an Int8Array). */
|
|
@@ -99,7 +101,12 @@ export function createVfsFilesystem(module: PostgresModule, vfs: BaseFilesystem)
|
|
|
99
101
|
() => {
|
|
100
102
|
if (attr.mode !== undefined) vfs.chmod(path, attr.mode);
|
|
101
103
|
if (attr.size !== undefined) vfs.truncate(path, attr.size);
|
|
102
|
-
|
|
104
|
+
const atime = attr.atime ?? attr.timestamp;
|
|
105
|
+
const mtime = attr.mtime ?? attr.timestamp;
|
|
106
|
+
if (atime !== undefined || mtime !== undefined) {
|
|
107
|
+
const previous = atime === undefined || mtime === undefined ? vfs.lstat(path) : undefined;
|
|
108
|
+
vfs.utimes(path, atime ?? previous!.atime, mtime ?? previous!.mtime);
|
|
109
|
+
}
|
|
103
110
|
},
|
|
104
111
|
"setattr",
|
|
105
112
|
path,
|