-
Notifications
You must be signed in to change notification settings - Fork 12
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
UUIDs serialized as text are bound as blob #29
Comments
A quick glimpse on the generator suggests that it should work. Could you setup a small example that repros the issue? The |
Sorry I haven't been precise enough.
What I am seeing is that I'll create a repro project. |
It actually seems to behave as documented?
|
But I'd still have a look whether I can improve something, if you attach a small demo project. |
Attached demo project. It runs two queries: the first one works when using either text or blob, the second one works when serialization is blob but fails when serialization is text. I did miss that part of the documentation but it seems pretty surprising to me that reading the columns works correctly, but using them in queries fails. Why is |
I need to check that in more detail, but generally the idea is that during read the affinity of the SQLite column is used. If it is a BLOB, it reads a binary UUID, if it is a TEXT, it reads the text. |
Right, reading works, the problem is the binding of the argument value to the statement is using the wrong style. |
I wonder whether the affinity of |
I have a table with UUID columns. If I set
uuidSerialization = text
the comparison between the column and a UUID fails because the argument is being bound asblob
becauseUUID.sqlUUIDStorageStyle
is.blob
.This returns no results, and I confirmed there are records with that id in a sqlite repl.
Setting
UUID.sqlUUIDStorageStyle = .string
in my code fixes this.I am investigating and it doesn't seem the serialization option is ever used to set the storage style. This seems to also be an issue for dates but I haven't verified.
I am using version 1.2.4.
The text was updated successfully, but these errors were encountered: