Skip to content

Share code between database application and SvelteKit application#271

Draft
ScriptRaccoon wants to merge 11 commits into
mainfrom
shared-code
Draft

Share code between database application and SvelteKit application#271
ScriptRaccoon wants to merge 11 commits into
mainfrom
shared-code

Conversation

@ScriptRaccoon

@ScriptRaccoon ScriptRaccoon commented Jul 8, 2026

Copy link
Copy Markdown
Owner

The repository basically contains two applications: the database application1 (seed files, seed script, deduction script, etc.) and the SvelteKit application (user interface). The database application lives in /databases, while the SvelteKit application lives in /src. Both have long relied on similar functions and configuration objects, but until now this code was duplicated rather than shared.

This PR resolves this by adding a new /shared folder at the root. Both the database application and the SvelteKit application now import common functions and configuration objects from there.

Moreover, the query utilities in the Svelte application have been removed, since the db.prepare function by better-sqlite3 already supports generics and no additional error handling is required.

1At the moment, the database application is simply a folder rather than a standalone package. A more systematic solution would be to turn the repository into a monorepo. I experimented with that a while ago, but it introduced enough complexity that I decided against it.


TODO:

  • check duplication TODOs

@ScriptRaccoon ScriptRaccoon force-pushed the shared-code branch 5 times, most recently from db5c78f to 481ac25 Compare July 9, 2026 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant