pglite icon indicating copy to clipboard operation
pglite copied to clipboard

[Help Wanted] PostGIS extension

Open tdrz opened this issue 2 months ago • 2 comments

Build postgis for pglite.

https://postgis.net/docs/postgis_installation.html#install_requirements

See branch https://github.com/electric-sql/pglite/tree/tdrz/frontend-try-postgis2

All necessary dependencies are built in that branch (see Dockerfile),and creating postgis.tar.gz is possible with some manual steps (see build-postgis.sh). There is a postgis.test.ts that contains a basic postgis test.

This is work in progress (ie not working)!

tdrz avatar Sep 29 '25 08:09 tdrz

Ideally the final binary will contain libstdc++ such that the MAIN_MODULE (ie to pglite.wasm) wouldn't need to contain it.

-Wl,--whole-archive -lstdc++ -Wl,--no-whole-archive

Is this possible with emscripten?

tdrz avatar Sep 29 '25 19:09 tdrz

You can now build the project the usual way pnpm build:all and run the tests. You can also run only the postgis tests by cd packages/pglite and then vitest tests/postgis.test.ts. Currently they are failing with missing symbols. We need a reliable way of extracting the needed symbols as this seems to be one of the issues with this extension.

tdrz avatar Sep 30 '25 12:09 tdrz