Share code between database application and SvelteKit application#271
Draft
ScriptRaccoon wants to merge 11 commits into
Draft
Share code between database application and SvelteKit application#271ScriptRaccoon wants to merge 11 commits into
ScriptRaccoon wants to merge 11 commits into
Conversation
db5c78f to
481ac25
Compare
fe9b977 to
29029ad
Compare
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.
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
/sharedfolder 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.preparefunction 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: