You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks that some auditing should be done indeed. Those are APIs I rarely use myself in this way, so I did not notice the problem.
I'll make an exhaustive list of methods that accept a generic DatabaseWriter or Reader.
I don't quite get why SE-0352 does not apply, though.
In the linked proposal text, search for "In the existing language, one could implement a shim..." The described technique will give you the needed workaround until GRDB7 can do what is needed so that no one faces the same issue as you do.
I'll open a Github issue in the Swift repo if something does not behave as described by the proposal, yes. I'll need a closer look. Meanwhile, we just need GRDB users to be able to use any DatabaseWriter freely, since this is how we can use a pool in the app, and a queue in tests and previews. That's what's important.
(I'm late in my answer because I was in vacations 😎)
What did you do?
I upgraded from GRDB 5.26.0 to 6.27.0, mostly seamlessly :)
What did you expect to happen?
We have some wrapper code that keeps the databaseWriter in following property:
Then, in our production code we use a
DatabasePool
, but in tests we would sometimes swap to an in-memoryDatabaseQueue
.This worked fine in GRDB 5 and I hoped it would behave the same in 6.
What happened instead?
The compiler complains that certain pieces like
ValueObservation
orDatabaseMigrator
expect asome DatabaseWriter
and notany DatabaseWriter
, like so:Environment
GRDB flavor(s): GRDB
GRDB version: 6.27.0
Installation method: SPM over Tuist
Xcode version: 15.3
Swift version: 5.10
Platform(s) running GRDB: iOS
macOS version running Xcode: Sonoma
Demo Project
Doesn't seem needed in this case
The text was updated successfully, but these errors were encountered: