Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decouple database dependency from GRDBQueryKey #14

Conversation

acosmicflamingo
Copy link

@acosmicflamingo acosmicflamingo commented Dec 3, 2024

If developers are to rely on the GRDB example as a guide for GRDB integration, it may be better to actually decouple the database dependency from GRDBQueryKey. Although everything currently works as-is because everything falls under the same namespace, I am finding that I can't simply copy and paste GRDBQueryKey code into my ComposableArchitectureExtensions library because the initializer has a database dependency that would be more appropriate to have in a separate library (e.g. LocalDatabaseClient).

I also think this is the way to go because I read somewhere in the Slack channel that the way Point-Free will be supporting GRDB isn't through some official code in the swift-sharing library itself, but rather an example that users can then copy-and-paste (which means it would be on us to maintain it after the code has made its way to our own codebases).

@mbrandonw mbrandonw mentioned this pull request Dec 3, 2024
@mbrandonw
Copy link
Member

Hey @acosmicflamingo, thanks for bringing this up! It is true that we don't want to currently support a full-fledged GRDB shared key for the library, but we can make the code in GRDBQueryKey.swift a little more self-contained. I have opened a PR (#15) for a slightly different approach, and so I will close this one for now.

@mbrandonw mbrandonw closed this Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants