@pgxsinkit/pgwasm-c 0.5.1 → 0.6.0-rc.1
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 +48 -22
- package/README.md +17 -5
- package/artefacts/amcheck.tar.gz +0 -0
- package/artefacts/initdb.js +1 -1
- package/artefacts/initdb.wasm +0 -0
- package/artefacts/postgres.data +7001 -6861
- 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 +22 -22
- package/dist/artefact-pins.d.ts.map +1 -1
- package/dist/build.d.ts +5 -4
- package/dist/build.d.ts.map +1 -1
- package/dist/host/emscripten.d.ts +13 -13
- package/dist/host/emscripten.d.ts.map +1 -1
- package/dist/host/initdb.d.ts.map +1 -1
- package/dist/host/postgres-instance.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +72 -35
- package/dist/index.js.map +8 -7
- package/dist/postgres-version.d.ts +18 -0
- package/dist/postgres-version.d.ts.map +1 -0
- package/dist/prepopulated.js.map +1 -1
- package/package.json +2 -2
- package/src/artefact-pins.ts +14 -14
- package/src/build.ts +20 -6
- package/src/host/emscripten.ts +13 -13
- package/src/host/initdb.ts +7 -5
- package/src/host/postgres-instance.ts +17 -17
- package/src/index.ts +1 -0
- package/src/postgres-version.ts +34 -0
package/NOTICE
CHANGED
|
@@ -24,8 +24,8 @@ PostgreSQL License text is in LICENSE.
|
|
|
24
24
|
The artefacts, and what is compiled into them
|
|
25
25
|
------------------------------------------------------------------------------
|
|
26
26
|
|
|
27
|
-
`artefacts/` holds seven files: the assets of the pgwasm-postgres release
|
|
28
|
-
(https://github.com/pgxsinkit/pgwasm-postgres/releases/tag/
|
|
27
|
+
`artefacts/` holds seven files: the assets of the pgwasm-postgres release 19.0.0-rc.1
|
|
28
|
+
(https://github.com/pgxsinkit/pgwasm-postgres/releases/tag/19.0.0-rc.1), republished byte-identical (each file's size and sha256 are pinned in
|
|
29
29
|
`src/artefact-pins.ts`, from the release's manifest.json checked against its
|
|
30
30
|
SHA256SUMS): `postgres.wasm` (the Postgres server), `postgres.data` (its filesystem
|
|
31
31
|
bundle: share files, loadable modules, time zone data, ICU data), `postgres.js` and
|
|
@@ -34,14 +34,14 @@ bundle: share files, loadable modules, time zone data, ICU data), `postgres.js`
|
|
|
34
34
|
the release's own initdb created, so it holds only what PostgreSQL itself wrote).
|
|
35
35
|
|
|
36
36
|
pgxsinkit/pgwasm-postgres (https://github.com/pgxsinkit/pgwasm-postgres) builds them
|
|
37
|
-
from PostgreSQL
|
|
38
|
-
|
|
37
|
+
from PostgreSQL 19rc1 (the upstream tag REL_19_RC1, commit
|
|
38
|
+
0b8bff042a997fe50fcd1c4c83b9ef1cc9ed8a89) plus a patch series and an overlay derived
|
|
39
39
|
from ElectricSQL's PGlite fork of PostgreSQL
|
|
40
40
|
(https://github.com/electric-sql/postgres-pglite at
|
|
41
41
|
b133782cd759f08b3aeb263b80a963b39c7b7af1; PostgreSQL License, Copyright (c)
|
|
42
|
-
ElectricSQL and contributors). Release
|
|
43
|
-
|
|
44
|
-
ghcr.io/pgxsinkit/pgwasm-builder@sha256:
|
|
42
|
+
ElectricSQL and contributors). Release 19.0.0-rc.1 is pgwasm-postgres commit
|
|
43
|
+
df4458a4fd3c0a546af29eb399bdfaa54eee70dd, built inside the builder image
|
|
44
|
+
ghcr.io/pgxsinkit/pgwasm-builder@sha256:cbb378a50de43cd2fbd8718b72ce4c7595ffe421148a3c32435906f096bc5130
|
|
45
45
|
(whose recipe is that repository's `builder/Containerfile`); its manifest.json records
|
|
46
46
|
every file's size and sha256, and the release was published only because a rebuild of
|
|
47
47
|
the tag gave the gated build's manifest.
|
|
@@ -50,9 +50,9 @@ The components below, and their versions, come from:
|
|
|
50
50
|
|
|
51
51
|
- the configure line: --with-icu --with-zlib --with-libxml --with-openssl=no
|
|
52
52
|
--without-llvm, and the server's link line (-lxml2 -lz, and ICU through ICU_LIBS);
|
|
53
|
-
- the builder recipe: Emscripten 6.0.
|
|
54
|
-
binaries confirm Emscripten 6.0.
|
|
55
|
-
(its data package,
|
|
53
|
+
- the builder recipe: Emscripten 6.0.13, zlib 1.3.2, libxml2 2.15.4, ICU 79.1. The
|
|
54
|
+
binaries confirm Emscripten 6.0.13 (in the server's version string) and ICU 79
|
|
55
|
+
(its data package, icudt79l);
|
|
56
56
|
- the files of postgres.data (dict_snowball.so, the time zone data, the ICU data and
|
|
57
57
|
its LICENSE).
|
|
58
58
|
|
|
@@ -64,7 +64,7 @@ libraries are in it.
|
|
|
64
64
|
Each component's notice follows, copied from the file named with it.
|
|
65
65
|
|
|
66
66
|
------------------------------------------------------------------------------
|
|
67
|
-
PostgreSQL
|
|
67
|
+
PostgreSQL 19rc1, with changes derived from ElectricSQL's for PGlite (postgres.wasm, initdb.wasm, postgres.data, amcheck.tar.gz)
|
|
68
68
|
------------------------------------------------------------------------------
|
|
69
69
|
|
|
70
70
|
Source: https://github.com/electric-sql/postgres-pglite at b133782cd759f08b3aeb263b80a963b39c7b7af1,
|
|
@@ -854,10 +854,10 @@ Source: https://raw.githubusercontent.com/snowballstem/snowball/d19326ac6c1b9a41
|
|
|
854
854
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
855
855
|
|
|
856
856
|
------------------------------------------------------------------------------
|
|
857
|
-
ICU
|
|
857
|
+
ICU 79.1 (postgres.wasm, initdb.wasm, and its data in postgres.data)
|
|
858
858
|
------------------------------------------------------------------------------
|
|
859
859
|
|
|
860
|
-
Source: https://raw.githubusercontent.com/unicode-org/icu/release-
|
|
860
|
+
Source: https://raw.githubusercontent.com/unicode-org/icu/release-79.1/LICENSE
|
|
861
861
|
The same file travels inside postgres.data at /pgwasm/icu/LICENSE (byte-identical).
|
|
862
862
|
PostgreSQL's own Unicode tables are generated from the Unicode Character Database,
|
|
863
863
|
whose terms are the Unicode License v3 at the start of this file.
|
|
@@ -866,7 +866,7 @@ whose terms are the Unicode License v3 at the start of this file.
|
|
|
866
866
|
|
|
867
867
|
COPYRIGHT AND PERMISSION NOTICE
|
|
868
868
|
|
|
869
|
-
Copyright ©
|
|
869
|
+
Copyright © 1991-2026 Unicode, Inc.
|
|
870
870
|
|
|
871
871
|
NOTICE TO USER: Carefully read the following legal agreement. BY
|
|
872
872
|
DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR
|
|
@@ -1405,6 +1405,32 @@ whose terms are the Unicode License v3 at the start of this file.
|
|
|
1405
1405
|
suitability of this software for any purpose. It is provided "as is"
|
|
1406
1406
|
without express or implied warranty.
|
|
1407
1407
|
|
|
1408
|
+
----------------------------------------------------------------------
|
|
1409
|
+
|
|
1410
|
+
File: sorttable.js (only for ICU4J)
|
|
1411
|
+
|
|
1412
|
+
The MIT Licence, for code from kryogenix.org
|
|
1413
|
+
|
|
1414
|
+
Code downloaded from the Browser Experiments section of kryogenix.org is
|
|
1415
|
+
licenced under the so-called MIT licence. The licence is below.
|
|
1416
|
+
|
|
1417
|
+
Copyright (c) 1997-date Stuart Langridge
|
|
1418
|
+
|
|
1419
|
+
Permission is hereby granted, free of charge, to any person obtaining a
|
|
1420
|
+
copy of this software and associated documentation files (the "Software"),
|
|
1421
|
+
to deal in the Software without restriction, including without limitation
|
|
1422
|
+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
1423
|
+
and/or sell copies of the Software, and to permit persons to whom the
|
|
1424
|
+
Software is furnished to do so, subject to the following conditions:
|
|
1425
|
+
|
|
1426
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
1427
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
1428
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
1429
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
1430
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
1431
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1432
|
+
SOFTWARE.
|
|
1433
|
+
|
|
1408
1434
|
------------------------------------------------------------------------------
|
|
1409
1435
|
libxml2 2.15.4 (postgres.wasm)
|
|
1410
1436
|
------------------------------------------------------------------------------
|
|
@@ -1466,10 +1492,10 @@ Source: https://raw.githubusercontent.com/madler/zlib/v1.3.2/LICENSE
|
|
|
1466
1492
|
jloup@gzip.org madler@alumni.caltech.edu
|
|
1467
1493
|
|
|
1468
1494
|
------------------------------------------------------------------------------
|
|
1469
|
-
Emscripten 6.0.
|
|
1495
|
+
Emscripten 6.0.13 (the runtime in postgres.js and initdb.js, and its system libraries in postgres.wasm and initdb.wasm)
|
|
1470
1496
|
------------------------------------------------------------------------------
|
|
1471
1497
|
|
|
1472
|
-
Source: https://raw.githubusercontent.com/emscripten-core/emscripten/6.0.
|
|
1498
|
+
Source: https://raw.githubusercontent.com/emscripten-core/emscripten/6.0.13/LICENSE
|
|
1473
1499
|
|
|
1474
1500
|
Emscripten is available under 2 licenses, the MIT license and the
|
|
1475
1501
|
University of Illinois/NCSA Open Source License.
|
|
@@ -1574,10 +1600,10 @@ Source: https://raw.githubusercontent.com/emscripten-core/emscripten/6.0.10/LICE
|
|
|
1574
1600
|
flag will run closure compiler from third_party/).
|
|
1575
1601
|
|
|
1576
1602
|
------------------------------------------------------------------------------
|
|
1577
|
-
musl libc, as bundled in Emscripten 6.0.
|
|
1603
|
+
musl libc, as bundled in Emscripten 6.0.13 (postgres.wasm, initdb.wasm)
|
|
1578
1604
|
------------------------------------------------------------------------------
|
|
1579
1605
|
|
|
1580
|
-
Source: https://raw.githubusercontent.com/emscripten-core/emscripten/6.0.
|
|
1606
|
+
Source: https://raw.githubusercontent.com/emscripten-core/emscripten/6.0.13/system/lib/libc/musl/COPYRIGHT
|
|
1581
1607
|
|
|
1582
1608
|
musl as a whole is licensed under the following standard MIT license:
|
|
1583
1609
|
|
|
@@ -1774,7 +1800,7 @@ Source: https://raw.githubusercontent.com/emscripten-core/emscripten/6.0.10/syst
|
|
|
1774
1800
|
obstacle to adoption, that text has been removed.
|
|
1775
1801
|
|
|
1776
1802
|
------------------------------------------------------------------------------
|
|
1777
|
-
LLVM runtime libraries, as bundled in Emscripten 6.0.
|
|
1803
|
+
LLVM runtime libraries, as bundled in Emscripten 6.0.13 (compiler-rt, libc++, libc++abi; postgres.wasm, initdb.wasm)
|
|
1778
1804
|
------------------------------------------------------------------------------
|
|
1779
1805
|
|
|
1780
1806
|
These are under the Apache License v2.0 with LLVM Exceptions. Their object code is
|
|
@@ -1799,7 +1825,7 @@ library's LICENSE.TXT, where it is identical):
|
|
|
1799
1825
|
|
|
1800
1826
|
Each library's LICENSE.TXT also carries the legacy LLVM licence:
|
|
1801
1827
|
|
|
1802
|
-
compiler-rt — https://raw.githubusercontent.com/emscripten-core/emscripten/6.0.
|
|
1828
|
+
compiler-rt — https://raw.githubusercontent.com/emscripten-core/emscripten/6.0.13/system/lib/compiler-rt/LICENSE.TXT
|
|
1803
1829
|
Legacy licence (dual NCSA / MIT; the MIT notice is reproduced):
|
|
1804
1830
|
|
|
1805
1831
|
The compiler_rt library is dual licensed under both the University of Illinois
|
|
@@ -1829,7 +1855,7 @@ Each library's LICENSE.TXT also carries the legacy LLVM licence:
|
|
|
1829
1855
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
1830
1856
|
THE SOFTWARE.
|
|
1831
1857
|
|
|
1832
|
-
libc++ — https://raw.githubusercontent.com/emscripten-core/emscripten/6.0.
|
|
1858
|
+
libc++ — https://raw.githubusercontent.com/emscripten-core/emscripten/6.0.13/system/lib/libcxx/LICENSE.TXT
|
|
1833
1859
|
Legacy licence (dual NCSA / MIT; the MIT notice is reproduced):
|
|
1834
1860
|
|
|
1835
1861
|
The libc++ library is dual licensed under both the University of Illinois
|
|
@@ -1859,7 +1885,7 @@ Each library's LICENSE.TXT also carries the legacy LLVM licence:
|
|
|
1859
1885
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
1860
1886
|
THE SOFTWARE.
|
|
1861
1887
|
|
|
1862
|
-
libc++abi — https://raw.githubusercontent.com/emscripten-core/emscripten/6.0.
|
|
1888
|
+
libc++abi — https://raw.githubusercontent.com/emscripten-core/emscripten/6.0.13/system/lib/libcxxabi/LICENSE.TXT
|
|
1863
1889
|
Legacy licence (dual NCSA / MIT; the MIT notice is reproduced):
|
|
1864
1890
|
|
|
1865
1891
|
The libc++abi library is dual licensed under both the University of Illinois
|
package/README.md
CHANGED
|
@@ -1,31 +1,43 @@
|
|
|
1
1
|
# @pgxsinkit/pgwasm-c
|
|
2
2
|
|
|
3
3
|
The C Postgres build for [`@pgxsinkit/pgwasm`](https://www.npmjs.com/package/@pgxsinkit/pgwasm):
|
|
4
|
-
PostgreSQL
|
|
4
|
+
PostgreSQL 19 RC1 compiled to WebAssembly with Emscripten, single-threaded, with the memory,
|
|
5
5
|
IndexedDB (`idb://`) and file (`file://`, Bun) filesystems.
|
|
6
6
|
|
|
7
|
+
This is the experimental PG19 release-candidate channel. Install matching `@rc` packages:
|
|
8
|
+
|
|
7
9
|
```bash
|
|
8
|
-
bun add @pgxsinkit/pgwasm @pgxsinkit/pgwasm-c
|
|
10
|
+
bun add @pgxsinkit/pgwasm@rc @pgxsinkit/pgwasm-c@rc
|
|
9
11
|
```
|
|
10
12
|
|
|
11
13
|
```ts
|
|
12
14
|
import { createPgwasm } from "@pgxsinkit/pgwasm";
|
|
13
15
|
import { cBuild } from "@pgxsinkit/pgwasm-c";
|
|
14
16
|
|
|
15
|
-
const pg = await createPgwasm({ build: cBuild, dataDir: "idb://my-app" });
|
|
17
|
+
const pg = await createPgwasm({ build: cBuild, dataDir: "idb://my-app-pg19-rc1" });
|
|
16
18
|
```
|
|
17
19
|
|
|
20
|
+
Use a fresh store with a separate name for PG19. This build uses data format 2 and refuses PG18
|
|
21
|
+
format-1 stores and backups, including unmarked PG18 directories. It does not migrate or delete an
|
|
22
|
+
existing store. Keep the PG18 packages and store available while evaluating the RC; the stable
|
|
23
|
+
`@latest` channel remains separate.
|
|
24
|
+
|
|
25
|
+
An unmarked directory from another PostgreSQL major raises `PostgresVersionMismatchError`.
|
|
26
|
+
The client treats it as a permanent refusal and does not retry the incompatible open.
|
|
27
|
+
|
|
18
28
|
The package ships its WebAssembly module, filesystem bundle and initdb as files next to its code,
|
|
19
29
|
referenced as `new URL("…", import.meta.url)`, so bundlers copy and fingerprint them.
|
|
20
30
|
|
|
21
31
|
## Bundlers
|
|
22
32
|
|
|
23
33
|
Vite: exclude the package from dependency pre-bundling, which would move the module away from its
|
|
24
|
-
files
|
|
34
|
+
files. Exclude `@pgxsinkit/pgwasm` with it, so the dev server loads pgwasm once, and list both in the
|
|
35
|
+
app's own dependencies: Vite resolves an excluded package from the app, even when another package
|
|
36
|
+
imports it.
|
|
25
37
|
|
|
26
38
|
```ts
|
|
27
39
|
// vite.config.ts
|
|
28
|
-
export default defineConfig({ optimizeDeps: { exclude: ["@pgxsinkit/pgwasm-c"] } });
|
|
40
|
+
export default defineConfig({ optimizeDeps: { exclude: ["@pgxsinkit/pgwasm", "@pgxsinkit/pgwasm-c"] } });
|
|
29
41
|
```
|
|
30
42
|
|
|
31
43
|
## Warming the artefacts early
|
package/artefacts/amcheck.tar.gz
CHANGED
|
Binary file
|