Repository navigation
Conversation
hoangvu12
force-pushed
the
plugin-service-db
branch
from
November 12, 2026 19:00
8c644c5 to
e370c85
Compare
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A plugin's service has no database.
zeron.dbexists only in its windows, so a service that keeps real data (a design tool's documents, an index, a history) has onlyzeron.store, which holds 1 MB in total. We hit this moving Zeron Design to a Luau plugin. Its service owns every Design and runs agents' calls with no window open, and every call failed with "attempt to index nil with 'exec'".Now a service has
zeron.db.execandzeron.db.query, with the same calls and promises as a window's. They open the same file,<data>/plugins/.storage/<id>.sqlite3, so what the service writes the windows read.crates/plugin-db. The app and the engine both use it, so the rules are written once: bound parameters only, no other file attached, and pragmas that lift the limits refused.max_page_count, so it's counted once for both.spawn_blocking, so a wait on the window's write doesn't stall the VM.Testing
zeron-plugin-db: the app's three tests moved unchanged. A new test,two_processes_share_one_database, runs its own binary again as a second process. The two processes write 400 rows each at once, reading between writes, and then both fill the database. No write is lost, no call fails on the other's lock,integrity_checkis ok, and the file stops at one limit.zeron-engine:a_service_and_its_windows_share_one_databasewrites from a service, reads the row from the window's path, and the reverse. The rows outlive the service stopping, and anATTACHis refused.cargo test -p zeron-plugin-dbpasses.cargo test -p zeron-engine --lib a_service_and_its_windows_share_one_databasepasses. On Windows the engine's lib tests need the twolibc::getrusagetest helpers gated to unix (chat_persistence.rs,source_control.rs) to compile. They fail the same way without this change, and that gate isn't in this PR.cargo metadata --lockedresolves both workspaces.