[PR #1723] Switch DB from better-sqlite3 to libsql #1194

Open
opened 2025-11-13 12:20:13 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/fosrl/pangolin/pull/1723
Author: @Lokowitz
Created: 10/21/2025
Status: 🔄 Open

Base: devHead: db-switch


📝 Commits (10+)

📊 Changes

43 files changed (+299 additions, -2752 deletions)

View changed files

📝 .github/workflows/cicd.yml (+1 -1)
📝 .github/workflows/linting.yml (+1 -1)
📝 .github/workflows/test.yml (+1 -1)
📝 Makefile (+8 -0)
📝 package-lock.json (+235 -288)
📝 package.json (+1 -2)
📝 server/db/sqlite/driver.ts (+3 -3)
📝 server/db/sqlite/migrate.ts (+1 -1)
📝 server/lib/consts.ts (+1 -1)
📝 server/private/routers/auth/quickStart.ts (+2 -2)
📝 server/private/routers/remoteExitNode/createRemoteExitNode.ts (+2 -2)
📝 server/private/routers/remoteExitNode/quickStartRemoteExitNode.ts (+2 -2)
📝 server/routers/auth/signup.ts (+2 -2)
📝 server/routers/newt/createNewt.ts (+2 -2)
📝 server/routers/olm/createOlm.ts (+2 -2)
📝 server/setup/migrationsPg.ts (+2 -0)
📝 server/setup/migrationsSqlite.ts (+13 -49)
📝 server/setup/scriptsPg/1.11.1.ts (+6 -2)
server/setup/scriptsSqlite/1.0.0-beta1.ts (+0 -5)
server/setup/scriptsSqlite/1.0.0-beta10.ts (+0 -44)

...and 23 more files

📄 Description

Community Contribution License Agreement

By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.

Description

Hey guys,
this is related to the issue that better-sqlite3 is not supporting async anymore.
This PR is an example how we could do the step to libsql with a minimum of effort.
This will require all users to migrate first to the latest available version (current 1.11.1) because I deleted all old migration files for sql because otherwise they need to be completely rewritten.
I added a check in server/setup/migrationsSqlite.ts to don't skip this task.

If you want to go to version 2.0.0 is up to you and can be changed as you like.

If you don't want to go this way and want to rewrite all migration files, than feel free to take over because this is out of my skills :-D

Cheers Marvin


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/fosrl/pangolin/pull/1723 **Author:** [@Lokowitz](https://github.com/Lokowitz) **Created:** 10/21/2025 **Status:** 🔄 Open **Base:** `dev` ← **Head:** `db-switch` --- ### 📝 Commits (10+) - [`0e1603c`](https://github.com/fosrl/pangolin/commit/0e1603c07d33de6d09f4028c202d14ba24b8ea42) first change to libsql - [`4a59823`](https://github.com/fosrl/pangolin/commit/4a59823e5838997017154717737bb97b9aaf11bc) Actually run the migrations; update exit nodes - [`18d8f72`](https://github.com/fosrl/pangolin/commit/18d8f72da2e77acb38f076e40cc520daa67bbd7b) Change runner back - [`d10830f`](https://github.com/fosrl/pangolin/commit/d10830f892bdf0375f8cd98ad0b89fd97e6d123d) Fix exitNodeId col - [`e77909d`](https://github.com/fosrl/pangolin/commit/e77909d49802a6494a9f0ea1e4603599369b9675) Change runs on - [`000d6ad`](https://github.com/fosrl/pangolin/commit/000d6adecbda6114cfdb95d7a85770f618815a52) Merge remote-tracking branch 'upstream/dev' into db-switch - [`acf23cc`](https://github.com/fosrl/pangolin/commit/acf23cc0253f1c60aa8fa755318e91779ab7c03c) merge upstream - [`d20dead`](https://github.com/fosrl/pangolin/commit/d20deadd1dc0714a04d215c17741240d57ef2189) add local test - [`ac04eec`](https://github.com/fosrl/pangolin/commit/ac04eec1466efb70ec2527fc04938b706fb1180a) migrations - [`fcad3a1`](https://github.com/fosrl/pangolin/commit/fcad3a185506e250c3e35df7432a8d9ca558102a) set min version to 1.11.2 ### 📊 Changes **43 files changed** (+299 additions, -2752 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/cicd.yml` (+1 -1) 📝 `.github/workflows/linting.yml` (+1 -1) 📝 `.github/workflows/test.yml` (+1 -1) 📝 `Makefile` (+8 -0) 📝 `package-lock.json` (+235 -288) 📝 `package.json` (+1 -2) 📝 `server/db/sqlite/driver.ts` (+3 -3) 📝 `server/db/sqlite/migrate.ts` (+1 -1) 📝 `server/lib/consts.ts` (+1 -1) 📝 `server/private/routers/auth/quickStart.ts` (+2 -2) 📝 `server/private/routers/remoteExitNode/createRemoteExitNode.ts` (+2 -2) 📝 `server/private/routers/remoteExitNode/quickStartRemoteExitNode.ts` (+2 -2) 📝 `server/routers/auth/signup.ts` (+2 -2) 📝 `server/routers/newt/createNewt.ts` (+2 -2) 📝 `server/routers/olm/createOlm.ts` (+2 -2) 📝 `server/setup/migrationsPg.ts` (+2 -0) 📝 `server/setup/migrationsSqlite.ts` (+13 -49) 📝 `server/setup/scriptsPg/1.11.1.ts` (+6 -2) ➖ `server/setup/scriptsSqlite/1.0.0-beta1.ts` (+0 -5) ➖ `server/setup/scriptsSqlite/1.0.0-beta10.ts` (+0 -44) _...and 23 more files_ </details> ### 📄 Description ## Community Contribution License Agreement By creating this pull request, I grant the project maintainers an unlimited, perpetual license to use, modify, and redistribute these contributions under any terms they choose, including both the AGPLv3 and the Fossorial Commercial license terms. I represent that I have the right to grant this license for all contributed content. ## Description Hey guys, this is related to the [issue](https://github.com/fosrl/pangolin/issues/1492) that better-sqlite3 is not supporting async anymore. This PR is an example how we could do the step to libsql with a minimum of effort. This will require all users to migrate first to the latest available version (current 1.11.1) because I deleted all old migration files for sql because otherwise they need to be completely rewritten. I added a check in `server/setup/migrationsSqlite.ts` to don't skip this task. If you want to go to version 2.0.0 is up to you and can be changed as you like. If you don't want to go this way and want to rewrite all migration files, than feel free to take over because this is out of my skills :-D Cheers Marvin --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the
pull-request
label 2025-11-13 12:20:13 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/pangolin#1194
No description provided.