PGlite on Val Town - A whole Postgres in your val
All you need to do is first import the Deno xmlhttprequest polyfill and then PGlite:
Create valimport "https://deno.land/x/xhr@0.1.0/mod.ts"; import { PGlite } from "https://cdn.jsdelivr.net/npm/@electric-sql/pglite/dist/index.js";
Importing using esm.sh doesn't seem to work, see https://github.com/electric-sql/pglite/issues/110
https://samwillis-pglite_http_preview_runtime.web.val.run
https://esm.town/v/samwillis/pglite_http_preview_runtime
<script type="module" src="https://esm.town/v/samwillis/pglite_http_preview_runtime" />