pglite
pglite copied to clipboard
Add PGVector Support
Hello PGlite maintainers,
I have pgvector linked statically same as plpgsql. I'm convinced despite this that dlopen cannot work in wasm. I gave the runtime linking approach considerable effort before capitulating back to trash-compacting all the objects in one step.
Some things you'll want to look at:
- I had to change
pg_config.h --> PG_VERSION_NUMto140000for the pgvector build to finish without problems. This change is reverted after thebuild:extstep is finished. - I haven't added tests for core pgvector functionality. I tested
CREATE EXTENSION vectorin a bun repl. - I added more patches to the
postgres.jsfile to fix problems with the postgres build on Ubuntu 22.04 WSL anddebian:bookworm. I'm surprised this wasn't a problem before? - I added the ability to set
nodeexactly in the Makefile underpackages/pglitebecuase I had some permissions problems with what I think was the node binary under emsdk. Maybe that was misdiagnosed and that change can be reverted.
(Hopes to close #18 and help #19)
Corresponding PR in the PG submodule: https://github.com/electric-sql/postgres-wasm/pull/10.