@di-framework/pglite-component 6.0.11 → 6.0.13

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/README.md CHANGED
@@ -87,7 +87,7 @@ Tags are movable. `0.2.0` always points to the latest `main` publish for WIT pac
87
87
  ### Artifact location
88
88
 
89
89
  The digest is in **Details** > **Record component digest** > **Step summary**, and in the `pglite-publish-report` artifact (`publish-report.json`).
90
- Published digest: `ghcr.io/di-framework/pglite-component@sha256:8bc30505cf28b1a65f72588da692d2ba3d79a6a2025c9256341a8625967a3286`
90
+ Published digest: `ghcr.io/di-framework/pglite-component@sha256:5784b08d96e4d52f4ce855f0bdcdb2bb50f87f74e5146e331c881f8f80c64878`
91
91
 
92
92
  **Note:** The GHCR package must be made public by an org admin after the first publish. Until then, only members with access to di-framework/platform can pull it.
93
93
 
@@ -125,7 +125,7 @@ wasmtime run --dir ./data::/data path/to/app.composed.wasm
125
125
  To use the published OCI component from GHCR instead (pin by digest for reproducibility):
126
126
 
127
127
  ```sh
128
- export PGLITE_REF='ghcr.io/di-framework/pglite-component@sha256:8bc30505cf28b1a65f72588da692d2ba3d79a6a2025c9256341a8625967a3286'
128
+ export PGLITE_REF='ghcr.io/di-framework/pglite-component@sha256:5784b08d96e4d52f4ce855f0bdcdb2bb50f87f74e5146e331c881f8f80c64878'
129
129
  wash oci pull "${PGLITE_REF}" pglite.wasm
130
130
  wac plug --plug pglite.wasm path/to/app.wasm -o path/to/app.composed.wasm
131
131
  mkdir -p ./data
@@ -250,6 +250,25 @@ machine-readable handling of constraint violations and other conditions:
250
250
  - `"22012"` = division by zero
251
251
  - `"54000"` = result too large
252
252
 
253
+ ## Extensions
254
+
255
+ The engine cannot load shared libraries, so extensions are linked into it
256
+ statically. It includes `plpgsql` and `pgcrypto`. Enable pgcrypto from a migration:
257
+
258
+ ```sql
259
+ CREATE EXTENSION IF NOT EXISTS pgcrypto;
260
+ SELECT pgp_sym_decrypt(pgp_sym_encrypt('secret', 'key'), 'key');
261
+ SELECT encode(digest('a', 'sha256'), 'hex');
262
+ SELECT crypt('password', gen_salt('bf'));
263
+ ```
264
+
265
+ pgcrypto links a static `libcrypto` built from the pinned OpenSSL 3.5 LTS
266
+ source (`OPENSSL_*` in `scripts/tool-versions.env`, Apache-2.0). Every salt,
267
+ PGP session key and padding byte comes from `pg_strong_random`, which the
268
+ engine routes to the host's WASI `random` interface. `gen_random_uuid()` is
269
+ built into PostgreSQL and works without the extension. Other contrib modules
270
+ are not included. The WIT interface does not change.
271
+
253
272
  ## Persistence and ownership
254
273
 
255
274
  For an `open("/data/orders", ...)` call:
@@ -299,6 +318,7 @@ annotations provide storage; they do not enforce database ownership.
299
318
  - `src/pgwire.rs`: PostgreSQL message encoding and typed rows, over memory.
300
319
  - `src/engine.rs`: persistent filesystem setup and exclusive engine access.
301
320
  - `engine/bridge.wat`: private canonical ABI bridge to the core engine.
321
+ - `engine/build-pgcrypto.sh`: builds OpenSSL libcrypto and pgcrypto in the engine container and generates pgcrypto's static `dlsym` table; `scripts/patch-engine-source.ts` links both into the engine.
302
322
  - `scripts/prepare-engine.ts`: pinned engine preparation and componentization (all build scripts are Bun TypeScript; see `scripts/`).
303
323
  - `wit/deps/pglite-engine/engine.wit`: internal interface, composed away at build.
304
324
 
@@ -1,13 +1,14 @@
1
1
  component: di-framework:pglite@0.2.0
2
2
  profile: release
3
- built: 2026-10-12T04:34:54Z
3
+ built: 2026-10-13T03:59:52Z
4
4
  rustc: rustc 1.97.1 (8bab26f4f 2026-07-14)
5
5
  target: wasm32-wasip2
6
6
  wasm-tools: wasm-tools 1.258.0 (5c6d31c78 2026-08-24)
7
7
  wit-bindgen: 0.61.1
8
8
  md5: 0.7.0
9
9
  engine: PostgreSQL 17.5, persistent WASI filesystem
10
+ extensions: plpgsql, pgcrypto (OpenSSL 3.5.9 libcrypto)
10
11
  engine-source: https://github.com/moznion/wasipg/tree/fa290be67946c0d3c4540bd1400b11e193d874e1
11
12
  adapter-sha256: e51dd61669a20daca34befe7fdadf1ac84e4795a2c84a8400818ee1de5373ccc
12
- engine-sha256: b4d513111988a9494ff506c57164762cae91d08c9e80ffdf10f349e5c7f24d7a
13
- size: 17990191 bytes
13
+ engine-sha256: e0afe7bc67537c40ae37655df4722987e968784c45a3684ed35df2f19d86bdbf
14
+ size: 20112680 bytes
package/dist/SHA256SUMS CHANGED
@@ -1,4 +1,4 @@
1
- e8681fc6d6099b33b57e9a63ed72622fa2796fc76c86a4087b6c72c2d8453892 di-framework-pglite.wasm
1
+ 269169e596bc15f4cb5539bc9af85e58f6ac9bb090dd1ba05254878768c6b823 di-framework-pglite.wasm
2
2
  6053154ec1bc94de63ce4f4f4cce5922ef57dce794c2dde326f5845b8982d35f di-framework-pglite.wit
3
- eac0414a2dd37c0a5ff904037d65a07aa0328fa8ccc2dcd77b7efd870b9425da BUILD-INFO.txt
4
- 0b8bbbe8aa2898431d20371148a445c9b1ecdecb2ca81d3c98d43256f650590e THIRD-PARTY-NOTICES.txt
3
+ fe25912019a7ee68094a301b7d61dab5ef4a39a9c4a7a7e3495394ff7957b413 BUILD-INFO.txt
4
+ f57bcfb7d092565405081e910da9816b6b6a23d916c28542bf5d469e4bd31ff7 THIRD-PARTY-NOTICES.txt
@@ -3,13 +3,16 @@ di-framework embedded PGlite component
3
3
  The provider bundles PostgreSQL 17.5 (PGlite WASI), originally maintained by
4
4
  ElectricSQL. PostgreSQL's license is reproduced in POSTGRESQL-COPYRIGHT.
5
5
  The upstream bindings license and WASI adapter license are reproduced in
6
- PGLITE-BINDINGS-LICENSE and WASMTIME-LICENSE.
6
+ PGLITE-BINDINGS-LICENSE and WASMTIME-LICENSE. The engine statically links
7
+ the pgcrypto extension and OpenSSL libcrypto; their notices are in
8
+ PGCRYPTO-NOTICES and the OpenSSL license (Apache-2.0) in OPENSSL-LICENSE.
7
9
 
8
10
  Sources:
9
11
  https://github.com/electric-sql/postgres-pglite
10
12
  https://github.com/electric-sql/pglite-bindings
11
13
  https://github.com/moznion/wasipg
12
14
  https://github.com/bytecodealliance/wasmtime/tree/v29.0.1
15
+ https://github.com/openssl/openssl/releases/tag/openssl-3.5.9
13
16
 
14
17
  The engine is compiled with PostgreSQL setjmp/longjmp recovery lowered to
15
18
  standardized WebAssembly exceptions. di-framework adds a private canonical
@@ -102,6 +105,270 @@ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
102
105
  AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
103
106
  ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO
104
107
  PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
108
+
109
+ --------------------------------------------------------------------------
110
+ pgcrypto (PostgreSQL 17.5 contrib/pgcrypto)
111
+ --------------------------------------------------------------------------
112
+
113
+ pgcrypto is part of PostgreSQL and is distributed under the PostgreSQL
114
+ License (POSTGRESQL-COPYRIGHT). Several of its source files carry these
115
+ additional notices, reproduced as their licenses require for binary
116
+ distribution.
117
+
118
+ px.c, px-hmac.c, px-crypt.c, mbuf.c, openssl.c, pgcrypto.c, pgp*.c and
119
+ their headers:
120
+
121
+ Copyright (c) 2001 Marko Kreen
122
+ Copyright (c) 2005 Marko Kreen
123
+ All rights reserved.
124
+
125
+ Redistribution and use in source and binary forms, with or without
126
+ modification, are permitted provided that the following conditions
127
+ are met:
128
+ 1. Redistributions of source code must retain the above copyright
129
+ notice, this list of conditions and the following disclaimer.
130
+ 2. Redistributions in binary form must reproduce the above copyright
131
+ notice, this list of conditions and the following disclaimer in the
132
+ documentation and/or other materials provided with the distribution.
133
+
134
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
135
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
136
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
137
+ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
138
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
139
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
140
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
141
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
142
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
143
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
144
+ SUCH DAMAGE.
145
+
146
+ crypt-des.c (FreeSec: libcrypt for NetBSD):
147
+
148
+ Copyright (c) 1994 David Burren
149
+ All rights reserved.
150
+
151
+ Redistribution and use in source and binary forms, with or without
152
+ modification, are permitted provided that the following conditions
153
+ are met:
154
+ 1. Redistributions of source code must retain the above copyright
155
+ notice, this list of conditions and the following disclaimer.
156
+ 2. Redistributions in binary form must reproduce the above copyright
157
+ notice, this list of conditions and the following disclaimer in the
158
+ documentation and/or other materials provided with the distribution.
159
+ 3. Neither the name of the author nor the names of other contributors
160
+ may be used to endorse or promote products derived from this software
161
+ without specific prior written permission.
162
+
163
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
164
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
165
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
166
+ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
167
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
168
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
169
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
170
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
171
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
172
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
173
+ SUCH DAMAGE.
174
+
175
+ crypt-md5.c: imported from FreeBSD, original by Poul-Henning Kamp.
176
+
177
+ crypt-blowfish.c and crypt-gensalt.c: written by Solar Designer
178
+ <solar at openwall.com> in 1998-2002 and placed in the public domain.
179
+
180
+ --------------------------------------------------------------------------
181
+ OpenSSL 3.5.9 (libcrypto)
182
+ --------------------------------------------------------------------------
183
+
184
+ pgcrypto links a static libcrypto built from the OpenSSL 3.5.9 release
185
+ source (https://github.com/openssl/openssl/releases/tag/openssl-3.5.9),
186
+ distributed under the Apache License, Version 2.0, reproduced in
187
+ OPENSSL-LICENSE:
188
+
189
+ Copyright (c) 1998-2026 The OpenSSL Project Authors
190
+ Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
191
+
192
+ It is compiled for wasm32-wasip1 without assembly, threads, sockets,
193
+ engines, loadable modules or configuration autoloading; no OpenSSL source
194
+ file is modified.
195
+
196
+ Apache License
197
+ Version 2.0, January 2004
198
+ https://www.apache.org/licenses/
199
+
200
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
201
+
202
+ 1. Definitions.
203
+
204
+ "License" shall mean the terms and conditions for use, reproduction,
205
+ and distribution as defined by Sections 1 through 9 of this document.
206
+
207
+ "Licensor" shall mean the copyright owner or entity authorized by
208
+ the copyright owner that is granting the License.
209
+
210
+ "Legal Entity" shall mean the union of the acting entity and all
211
+ other entities that control, are controlled by, or are under common
212
+ control with that entity. For the purposes of this definition,
213
+ "control" means (i) the power, direct or indirect, to cause the
214
+ direction or management of such entity, whether by contract or
215
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
216
+ outstanding shares, or (iii) beneficial ownership of such entity.
217
+
218
+ "You" (or "Your") shall mean an individual or Legal Entity
219
+ exercising permissions granted by this License.
220
+
221
+ "Source" form shall mean the preferred form for making modifications,
222
+ including but not limited to software source code, documentation
223
+ source, and configuration files.
224
+
225
+ "Object" form shall mean any form resulting from mechanical
226
+ transformation or translation of a Source form, including but
227
+ not limited to compiled object code, generated documentation,
228
+ and conversions to other media types.
229
+
230
+ "Work" shall mean the work of authorship, whether in Source or
231
+ Object form, made available under the License, as indicated by a
232
+ copyright notice that is included in or attached to the work
233
+ (an example is provided in the Appendix below).
234
+
235
+ "Derivative Works" shall mean any work, whether in Source or Object
236
+ form, that is based on (or derived from) the Work and for which the
237
+ editorial revisions, annotations, elaborations, or other modifications
238
+ represent, as a whole, an original work of authorship. For the purposes
239
+ of this License, Derivative Works shall not include works that remain
240
+ separable from, or merely link (or bind by name) to the interfaces of,
241
+ the Work and Derivative Works thereof.
242
+
243
+ "Contribution" shall mean any work of authorship, including
244
+ the original version of the Work and any modifications or additions
245
+ to that Work or Derivative Works thereof, that is intentionally
246
+ submitted to Licensor for inclusion in the Work by the copyright owner
247
+ or by an individual or Legal Entity authorized to submit on behalf of
248
+ the copyright owner. For the purposes of this definition, "submitted"
249
+ means any form of electronic, verbal, or written communication sent
250
+ to the Licensor or its representatives, including but not limited to
251
+ communication on electronic mailing lists, source code control systems,
252
+ and issue tracking systems that are managed by, or on behalf of, the
253
+ Licensor for the purpose of discussing and improving the Work, but
254
+ excluding communication that is conspicuously marked or otherwise
255
+ designated in writing by the copyright owner as "Not a Contribution."
256
+
257
+ "Contributor" shall mean Licensor and any individual or Legal Entity
258
+ on behalf of whom a Contribution has been received by Licensor and
259
+ subsequently incorporated within the Work.
260
+
261
+ 2. Grant of Copyright License. Subject to the terms and conditions of
262
+ this License, each Contributor hereby grants to You a perpetual,
263
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
264
+ copyright license to reproduce, prepare Derivative Works of,
265
+ publicly display, publicly perform, sublicense, and distribute the
266
+ Work and such Derivative Works in Source or Object form.
267
+
268
+ 3. Grant of Patent License. Subject to the terms and conditions of
269
+ this License, each Contributor hereby grants to You a perpetual,
270
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
271
+ (except as stated in this section) patent license to make, have made,
272
+ use, offer to sell, sell, import, and otherwise transfer the Work,
273
+ where such license applies only to those patent claims licensable
274
+ by such Contributor that are necessarily infringed by their
275
+ Contribution(s) alone or by combination of their Contribution(s)
276
+ with the Work to which such Contribution(s) was submitted. If You
277
+ institute patent litigation against any entity (including a
278
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
279
+ or a Contribution incorporated within the Work constitutes direct
280
+ or contributory patent infringement, then any patent licenses
281
+ granted to You under this License for that Work shall terminate
282
+ as of the date such litigation is filed.
283
+
284
+ 4. Redistribution. You may reproduce and distribute copies of the
285
+ Work or Derivative Works thereof in any medium, with or without
286
+ modifications, and in Source or Object form, provided that You
287
+ meet the following conditions:
288
+
289
+ (a) You must give any other recipients of the Work or
290
+ Derivative Works a copy of this License; and
291
+
292
+ (b) You must cause any modified files to carry prominent notices
293
+ stating that You changed the files; and
294
+
295
+ (c) You must retain, in the Source form of any Derivative Works
296
+ that You distribute, all copyright, patent, trademark, and
297
+ attribution notices from the Source form of the Work,
298
+ excluding those notices that do not pertain to any part of
299
+ the Derivative Works; and
300
+
301
+ (d) If the Work includes a "NOTICE" text file as part of its
302
+ distribution, then any Derivative Works that You distribute must
303
+ include a readable copy of the attribution notices contained
304
+ within such NOTICE file, excluding those notices that do not
305
+ pertain to any part of the Derivative Works, in at least one
306
+ of the following places: within a NOTICE text file distributed
307
+ as part of the Derivative Works; within the Source form or
308
+ documentation, if provided along with the Derivative Works; or,
309
+ within a display generated by the Derivative Works, if and
310
+ wherever such third-party notices normally appear. The contents
311
+ of the NOTICE file are for informational purposes only and
312
+ do not modify the License. You may add Your own attribution
313
+ notices within Derivative Works that You distribute, alongside
314
+ or as an addendum to the NOTICE text from the Work, provided
315
+ that such additional attribution notices cannot be construed
316
+ as modifying the License.
317
+
318
+ You may add Your own copyright statement to Your modifications and
319
+ may provide additional or different license terms and conditions
320
+ for use, reproduction, or distribution of Your modifications, or
321
+ for any such Derivative Works as a whole, provided Your use,
322
+ reproduction, and distribution of the Work otherwise complies with
323
+ the conditions stated in this License.
324
+
325
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
326
+ any Contribution intentionally submitted for inclusion in the Work
327
+ by You to the Licensor shall be under the terms and conditions of
328
+ this License, without any additional terms or conditions.
329
+ Notwithstanding the above, nothing herein shall supersede or modify
330
+ the terms of any separate license agreement you may have executed
331
+ with Licensor regarding such Contributions.
332
+
333
+ 6. Trademarks. This License does not grant permission to use the trade
334
+ names, trademarks, service marks, or product names of the Licensor,
335
+ except as required for reasonable and customary use in describing the
336
+ origin of the Work and reproducing the content of the NOTICE file.
337
+
338
+ 7. Disclaimer of Warranty. Unless required by applicable law or
339
+ agreed to in writing, Licensor provides the Work (and each
340
+ Contributor provides its Contributions) on an "AS IS" BASIS,
341
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
342
+ implied, including, without limitation, any warranties or conditions
343
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
344
+ PARTICULAR PURPOSE. You are solely responsible for determining the
345
+ appropriateness of using or redistributing the Work and assume any
346
+ risks associated with Your exercise of permissions under this License.
347
+
348
+ 8. Limitation of Liability. In no event and under no legal theory,
349
+ whether in tort (including negligence), contract, or otherwise,
350
+ unless required by applicable law (such as deliberate and grossly
351
+ negligent acts) or agreed to in writing, shall any Contributor be
352
+ liable to You for damages, including any direct, indirect, special,
353
+ incidental, or consequential damages of any character arising as a
354
+ result of this License or out of the use or inability to use the
355
+ Work (including but not limited to damages for loss of goodwill,
356
+ work stoppage, computer failure or malfunction, or any and all
357
+ other commercial damages or losses), even if such Contributor
358
+ has been advised of the possibility of such damages.
359
+
360
+ 9. Accepting Warranty or Additional Liability. While redistributing
361
+ the Work or Derivative Works thereof, You may choose to offer,
362
+ and charge a fee for, acceptance of support, warranty, indemnity,
363
+ or other liability obligations and/or rights consistent with this
364
+ License. However, in accepting such obligations, You may act only
365
+ on Your own behalf and on Your sole responsibility, not on behalf
366
+ of any other Contributor, and only if You agree to indemnify,
367
+ defend, and hold each Contributor harmless for any liability
368
+ incurred by, or claims asserted against, such Contributor by reason
369
+ of your accepting any such warranty or additional liability.
370
+
371
+ END OF TERMS AND CONDITIONS
105
372
  MIT License
106
373
 
107
374
  Copyright (c) 2024 ElectricSQL
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@di-framework/pglite-component",
3
- "version": "6.0.11",
3
+ "version": "6.0.13",
4
4
  "type": "module",
5
5
  "description": "Embedded PostgreSQL component with persistent WASI storage and no TCP, plus its SqlDatabase adapter for @di-framework/repo.",
6
6
  "license": "(MIT OR Apache-2.0)",