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
OptionalQueryable & ListQueryable helper protocols #39
Comments
Perhaps the |
Hello @FullQueueDeveloper, Thank you :-) These sub-protocols can live and work when embedded in your app, and I think this is their best home. They represent your own practices, which, while totally valid, are quite specific to your current setup. For example, you have noticed that people might want to use a different configuration of the database publishers. Why not keep things simple? Your protocols fit your needs without this extra configuration complexity, and this looks pretty satisfying to me. Also, not everybody puts a raw I hope users will stumble on this issue, get inspired by your protocols, and tune them for their own apps! |
Some extra comments: Your testing setup is good, I like it 👍
Doesn't it work with a plain |
Ah not sure which query it was that needed that, but you're right, it's not a sensible default. |
I've used
GRDBQuery
on several projects now, it's a good package.I endup pasting the following two helpers into all of my projects. I noticed that GRDBQuery doesn't depend on GRDB, so I can't directly open a pull request to share these. Writing about them here in case some one might find them useful, or might find a way to include them in either GRDB or GRDBQuery.
Example
Where
MyRecord
conforms toCodable
andFetchableRecord
, and whereMyRecord.CodingKeys
conforms toColumnExpression
.Testing
Also, with these helpers, it's easy to write tests around the query.
Where
AppDatabase.fixture()
is aDatabaseQueue
with the migrations run and some fixtures added.The text was updated successfully, but these errors were encountered: