PostgreSQL server providing ephemeral per-user databases for educational environments.
Each user connecting to this server gets their own isolated, in-memory PostgreSQL database. When they disconnect, their database is destroyed. Each database is initialized from a SQL dump file based on the username.
git clone https://github.com/sad-pixel/pglite-hypervisor.git
cd pglite-hypervisor
bun installbun startWith options:
bun start --port 5433 --dump-dir ./my_dumps --debug-p, --port- Port to listen on (default: 5432)-h, --host- Host to bind to (default: 127.0.0.1)-d, --dump-dir- Directory containing SQL dump files (default: ./db_dumps)-v, --debug- Enable debug logging--help- Show help message
Place SQL dump files in the dump directory named as <username>.sql
Example:
db_dumps/
dataset1.sql
dataset2.sql
eshop.sql
psql -h 127.0.0.1 -p 5432 -U <username> -d postgresPassword must match the username.
Example:
psql -h 127.0.0.1 -p 5432 -U student1 -d postgres
# Password: student1- Client connects with username
- Server creates a new PGlite instance in memory
- Server loads
<username>.sqlfrom the dump directory - Client can query their isolated database
- When client disconnects, database is destroyed
The included SQL dump files (eshop.sql, flis.sql, lis.sql, and university.sql) are copyright IIT Madras and may only be used for educational purposes.
The code is under MIT license subject to the statement below:
Copyright 2026 Ishan Das Sharma
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.