-
|
Hi there, Here's the context: I also added some protocol conformances as described in GRDB's documentation. But here's the thing: whenever I mix and match pure GRDB APIs with StructuredQueries APIs, I get the following error: This is coming from SharingGRDB's following function (in @inlinable
mutating func decode(_ columnType: UUID.Type) throws -> UUID? {
guard let uuidString = try decode(String.self) else { return nil }
guard let uuid = UUID(uuidString: uuidString) else { throw InvalidUUID() }
return uuid
}What I don't understand is when I don't mix those APIs it works perfectly fine! (I've tried that already, what I need to do is import the data and read it either from SharingGRDB only or GRDB only…) Is there some limitations regarding UUIDs when using both libraries that I'm not aware of? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
|
Hi @Pomanks, are you writing to the database using GRDB’s tools and reading from the database using ours? If so, is there a chance the UUID is stored as bytes in your database? Our library assumes string UUIDs by default, with the option to store as bytes. You should be able to open your database to check how the data is stored. Or if you provide a reproducing example we will take a look. |
Beta Was this translation helpful? Give feedback.
I haven't tested it, but this compiles and I believe should work:
Wanna give it a shot?