[PR #4696] [CLOSED] [WIP] [POC] PGLite as replacement for absurd-sql/sql.js #5541

Closed
opened 2026-02-28 21:14:06 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/4696
Author: @joel-jeremy
Created: 3/27/2025
Status: Closed

Base: masterHead: pglite


📝 Commits (10+)

  • 85f9ae3 PGlite migrations
  • a00b72b Update migrations
  • 9146020 Set parsers and serializers on openDatabase
  • 4f72ea2 Drizzle migrations
  • 50957ef Remove pglite filter
  • f23adee Update with indeces
  • 1b2126a Update drizzle migrations table
  • 7e1cf89 Update schema and add indeces
  • d3b865c Update migration to use builtin PgDialect migrate
  • db63467 Migrations update to use "actual" schema

📊 Changes

88 files changed (+47651 additions, -18 deletions)

View changed files

📝 eslint.config.mjs (+1 -0)
📝 package.json (+1 -0)
📝 packages/desktop-client/vite.config.mts (+4 -1)
packages/loot-core/bin/compile-drizzle-migrations.mjs (+16 -0)
packages/loot-core/drizzle.config.ts (+12 -0)
packages/loot-core/drizzle/0000_actual.sql (+1 -0)
packages/loot-core/drizzle/0001_banks.sql (+8 -0)
packages/loot-core/drizzle/0002_accounts.sql (+25 -0)
packages/loot-core/drizzle/0003_category_groups.sql (+12 -0)
packages/loot-core/drizzle/0004_categories.sql (+16 -0)
packages/loot-core/drizzle/0005_category_mapping.sql (+8 -0)
packages/loot-core/drizzle/0006_kvcache.sql (+4 -0)
packages/loot-core/drizzle/0007_kvcache_key.sql (+4 -0)
packages/loot-core/drizzle/0008_messages_clock.sql (+6 -0)
packages/loot-core/drizzle/0009_messages_crdt.sql (+11 -0)
packages/loot-core/drizzle/0010_notes.sql (+6 -0)
packages/loot-core/drizzle/0011_payees.sql (+13 -0)
packages/loot-core/drizzle/0012_payee_mapping.sql (+8 -0)
packages/loot-core/drizzle/0013_rules.sql (+12 -0)
packages/loot-core/drizzle/0014_schedules.sql (+14 -0)

...and 68 more files

📄 Description

  • Run migrations to build the equivalent schema in pglite
  • Insert data that is inserted to sqlite into pglite (side-by-side)
  • Switch reading data from sqlite to pglite
  • Export and import data dir dumps of budgets (remote budget file support)
  • Configure drizzle to use appropriate pglite filesystem for Electron app
  • Configure drizzle to use appropriate pglite filesystem for API

For this POC PR, this is now able to run the drizzle migrations on the browser:
image

The schema/tables are successfully being created, but no data is being read/written to this database yet.
image


🔄 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/actualbudget/actual/pull/4696 **Author:** [@joel-jeremy](https://github.com/joel-jeremy) **Created:** 3/27/2025 **Status:** ❌ Closed **Base:** `master` ← **Head:** `pglite` --- ### 📝 Commits (10+) - [`85f9ae3`](https://github.com/actualbudget/actual/commit/85f9ae3cb9d1e2cb066b1247f417663115121dd0) PGlite migrations - [`a00b72b`](https://github.com/actualbudget/actual/commit/a00b72bcdced4743c74f201c78e457e1d2373c93) Update migrations - [`9146020`](https://github.com/actualbudget/actual/commit/9146020db2bf6a847100a65c541bf651b36b4ab1) Set parsers and serializers on openDatabase - [`4f72ea2`](https://github.com/actualbudget/actual/commit/4f72ea2dae6dd1e0617662faf0a0aed6ce96dd6e) Drizzle migrations - [`50957ef`](https://github.com/actualbudget/actual/commit/50957ef23b6c6f2d18fda853cb183164e04823fd) Remove pglite filter - [`f23adee`](https://github.com/actualbudget/actual/commit/f23adeed2f0b7053aae54a845d40cc52a20591e1) Update with indeces - [`1b2126a`](https://github.com/actualbudget/actual/commit/1b2126ae4c5366df43b7e18bda9e72a2c665b9b4) Update drizzle migrations table - [`7e1cf89`](https://github.com/actualbudget/actual/commit/7e1cf8937e007dc74cfd22357b6bbfc152f1b5d2) Update schema and add indeces - [`d3b865c`](https://github.com/actualbudget/actual/commit/d3b865cf8a7ce861ba1b388ff2f149482708d876) Update migration to use builtin PgDialect migrate - [`db63467`](https://github.com/actualbudget/actual/commit/db63467957fb2b39e590023c8c926a55b0017bab) Migrations update to use "actual" schema ### 📊 Changes **88 files changed** (+47651 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `eslint.config.mjs` (+1 -0) 📝 `package.json` (+1 -0) 📝 `packages/desktop-client/vite.config.mts` (+4 -1) ➕ `packages/loot-core/bin/compile-drizzle-migrations.mjs` (+16 -0) ➕ `packages/loot-core/drizzle.config.ts` (+12 -0) ➕ `packages/loot-core/drizzle/0000_actual.sql` (+1 -0) ➕ `packages/loot-core/drizzle/0001_banks.sql` (+8 -0) ➕ `packages/loot-core/drizzle/0002_accounts.sql` (+25 -0) ➕ `packages/loot-core/drizzle/0003_category_groups.sql` (+12 -0) ➕ `packages/loot-core/drizzle/0004_categories.sql` (+16 -0) ➕ `packages/loot-core/drizzle/0005_category_mapping.sql` (+8 -0) ➕ `packages/loot-core/drizzle/0006_kvcache.sql` (+4 -0) ➕ `packages/loot-core/drizzle/0007_kvcache_key.sql` (+4 -0) ➕ `packages/loot-core/drizzle/0008_messages_clock.sql` (+6 -0) ➕ `packages/loot-core/drizzle/0009_messages_crdt.sql` (+11 -0) ➕ `packages/loot-core/drizzle/0010_notes.sql` (+6 -0) ➕ `packages/loot-core/drizzle/0011_payees.sql` (+13 -0) ➕ `packages/loot-core/drizzle/0012_payee_mapping.sql` (+8 -0) ➕ `packages/loot-core/drizzle/0013_rules.sql` (+12 -0) ➕ `packages/loot-core/drizzle/0014_schedules.sql` (+14 -0) _...and 68 more files_ </details> ### 📄 Description <!-- Thank you for submitting a pull request! Make sure to follow the instructions to write release notes for your PR — it should only take a minute or two: https://github.com/actualbudget/docs#writing-good-release-notes. Try running yarn generate:release-notes *before* pushing your PR for an interactive experience. --> - [x] Run migrations to build the equivalent schema in pglite - [ ] Insert data that is inserted to sqlite into pglite (side-by-side) - [ ] Switch reading data from sqlite to pglite - [ ] Export and import data dir dumps of budgets (remote budget file support) - [ ] Configure drizzle to use appropriate pglite filesystem for Electron app - [ ] Configure drizzle to use appropriate pglite filesystem for API For this POC PR, this is now able to run the drizzle migrations on the browser: ![image](https://github.com/user-attachments/assets/c58e6450-21aa-4d67-81c8-dde049386787) The schema/tables are successfully being created, but no data is being read/written to this database yet. ![image](https://github.com/user-attachments/assets/d92ea38a-1736-4ecf-a09f-79a2b0999f92) --- <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 2026-02-28 21:14:07 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#5541