Skip to content
Discussion options

You must be logged in to vote

Hi @MrSkwiggs, if you are wanting the type of query that can be loaded into @FetchAll, then you can use Statement:

func observable() -> any Statement<Player>

However, I'm not really sure what your abstraction is buying you. First, you still have to use @FetchAll in the model, and so you're not really insulating yourself from the APIs of the library. And that is just something that you will have to live with because there is no way to abstract away that tool.

And second, what would another conformance of PlayerRepository even look like? Typically these kinds of protocols are to make code more testable so that you can provide test-friendly implementations in tests. But in the case of SQLite…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@MrSkwiggs
Comment options

@MrSkwiggs
Comment options

@mbrandonw
Comment options

@MrSkwiggs
Comment options

@mbrandonw
Comment options

Answer selected by MrSkwiggs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants