I can see this very useful for small self-hosted applications. I could imagine deploying this instead of sqlite in some cases. Though having a real server is not maybe ideal for self-hosted apps.
For unit tests I've found that I don't need PGLite or other tools, only podman and official images.
Regular postgres starts in 800 milliseconds, TimeScale DB in 1 second.
I have setup where first unit test that starts podman container and after finish it ends it all. On each test I create new database (or search path), time it takes to create db is in milliseconds.
I've played with databases and schemas for isolating tests, but I think pgtestdb has the winning concept: load fixtures into a template database and clone if for each test https://github.com/peterldowns/pgtestdb
For folks working in this area, may I request a MySQL/mariadb-lite?
pglite is great for browser / testing emulation for PG. MySQL in browser does not have an equally good story. Closest is https://github.com/ephpm/litewire , but it isnt really MySQL fully.
This I think is wonderful. I've used SQLite on Node.js but had many problems trying to deploy it together with my app, because there were so many (moving) parts to the system and they had to get deployed into the Vercel PKG EXE. It worked well until it didn't. But if there is only one file needed to include the database "server", it will be so much more robust and resilient to environment changes around the build-process.
So, does this work well on Node.js? If it does I'm willing to make the jump from SQLite to this.
May I ask what moving parts you're referring to that make deploying it cumbersome?
Since SQLite comes natively with Node.js (node:sqlite since Node.js v22.5.0) things got a lot easier. Before that the npm packages relying on native builds were a bit annoying for me as well.
I haven't worked with it lately since the database is not a critical part of my system. The problems were basically caused because SQLite requires non-JS libraries and they need to be found in the right place, and compiled and packaged into Vercel-PKG exe, and I got obscure error-messsages.
Happy to hear things are getting smoother with Node.js SQLite, but then I have the other problem that Vercel-PKG support stopped at a specific Node.js level, so I wouldn't be able to use the native Node.js SQLite anyway I assume .
Now lately I discovered that there is an open-source fork of Vercel-PKG which supports later Node.js versions:
npmjs.com/package/@yao-pkg/pkg?activeTab=readme&__cf_chl_tk=eDzgWvIL2OkIxMCGlCoLW6Mi2t2ciRkE6HMYKl46MnY-1795671127-1.0.1.1-fY.UrK80ucEtTwp1j_XEPi4eI5iwficmiVkl4qjE1HY .
Once I get my build-process ported to that or something similar I will certainly revisit the database question again for my project.
But then whether the Node.js native SQLite runs after compiling it into the Vercel-PKG exe lookalike I don't know (yet).
Since minipg is a standalone executable, so I’m not sure it would work there? If if Vercel has WASM support, check out https://pglite.dev/ -- I’m using it with Node apps for local dev and it works nearly flawlessly. (In production, I tend to run a full Postgres setup on my own server, or just use hosted Postgres.)
Edit: yeah, I also got confused about the “Vercel PKG EXE”, haha
I can see this very useful for small self-hosted applications. I could imagine deploying this instead of sqlite in some cases. Though having a real server is not maybe ideal for self-hosted apps.
For unit tests I've found that I don't need PGLite or other tools, only podman and official images.
Regular postgres starts in 800 milliseconds, TimeScale DB in 1 second.
I have setup where first unit test that starts podman container and after finish it ends it all. On each test I create new database (or search path), time it takes to create db is in milliseconds.
Trick is to use `--image-volume tmpfs` when starting the container. I have my pg test server as Rust in here: https://github.com/Ciantic/app-frame/blob/main/crates/pgtest...
I've played with databases and schemas for isolating tests, but I think pgtestdb has the winning concept: load fixtures into a template database and clone if for each test https://github.com/peterldowns/pgtestdb
Impressive. Uses postgres alpine's docker image, without docker. Instead it used h9, a young embedded hypervisor tool.
Author's post on the subject -- https://progrium.xyz/articles/2026/single-binary-postgres/
This seems to be ideal for testing purposes. Great to use this in a 16gb mac so I do not have to install docker.
How does it compare to https://pglite.dev
pglite webassembly single binary this is just a single binary running via h9 virtualized plan9
So this uses virtualization and pglite does not. Seems like pglite is lighter then.
https://github.com/lucianmarin/strictql
For folks working in this area, may I request a MySQL/mariadb-lite?
pglite is great for browser / testing emulation for PG. MySQL in browser does not have an equally good story. Closest is https://github.com/ephpm/litewire , but it isnt really MySQL fully.
this https://progrium.github.io/hyper9/ sounds really impressive..
Anyone got some input on how this compares to lxc?
This I think is wonderful. I've used SQLite on Node.js but had many problems trying to deploy it together with my app, because there were so many (moving) parts to the system and they had to get deployed into the Vercel PKG EXE. It worked well until it didn't. But if there is only one file needed to include the database "server", it will be so much more robust and resilient to environment changes around the build-process.
So, does this work well on Node.js? If it does I'm willing to make the jump from SQLite to this.
May I ask what moving parts you're referring to that make deploying it cumbersome? Since SQLite comes natively with Node.js (node:sqlite since Node.js v22.5.0) things got a lot easier. Before that the npm packages relying on native builds were a bit annoying for me as well.
I haven't worked with it lately since the database is not a critical part of my system. The problems were basically caused because SQLite requires non-JS libraries and they need to be found in the right place, and compiled and packaged into Vercel-PKG exe, and I got obscure error-messsages.
Happy to hear things are getting smoother with Node.js SQLite, but then I have the other problem that Vercel-PKG support stopped at a specific Node.js level, so I wouldn't be able to use the native Node.js SQLite anyway I assume .
Now lately I discovered that there is an open-source fork of Vercel-PKG which supports later Node.js versions: npmjs.com/package/@yao-pkg/pkg?activeTab=readme&__cf_chl_tk=eDzgWvIL2OkIxMCGlCoLW6Mi2t2ciRkE6HMYKl46MnY-1795671127-1.0.1.1-fY.UrK80ucEtTwp1j_XEPi4eI5iwficmiVkl4qjE1HY .
Once I get my build-process ported to that or something similar I will certainly revisit the database question again for my project.
But then whether the Node.js native SQLite runs after compiling it into the Vercel-PKG exe lookalike I don't know (yet).
Ever thought about dropping vercel and using a proper deployment environment?
Try reading the other word appended to Vercel
Node also has its own single executable thing now: https://nodejs.org/api/single-executable-applications.html
There’s also pgapp, which I’ve always loved.
Since minipg is a standalone executable, so I’m not sure it would work there? If if Vercel has WASM support, check out https://pglite.dev/ -- I’m using it with Node apps for local dev and it works nearly flawlessly. (In production, I tend to run a full Postgres setup on my own server, or just use hosted Postgres.)
Edit: yeah, I also got confused about the “Vercel PKG EXE”, haha
nice, but could it please not download 35 on page enter? I was curious and luckily on train wifi
*35 MB
Not very nice, yeah, I’d put that behind a “play” button of sorts.