-
Notifications
You must be signed in to change notification settings - Fork 44
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
Handling of UUIDs #51
Comments
My only concern with using the binary is that it is much harder to work with when using I think it is reasonable to make it configurable - Postgres does this with the
We can do this by doing:
What do you think, @LostKobrakai ? |
I'm happy to leave it configurable for as long as we can somehow use the raw binary representation, though the column type is only part of the picture, the encoding/decoding is the bigger one :) |
Yeah, I think the loader/dumper can just look at that same config to determine which way to process it. |
Yea I'd be okay with a configurable option with how to handle that. We could also do the same thing for |
@kevinlang looking at the code in that extension, it looks like it is fallback safe and stores the values as bytes. But again, it won't be human friendly for those using a client without the extension. It would also make it incredibly difficult to insert a new record through the CLI for maintenance and what not. |
While making sure we don't run into compatibility issues migrating from the sqlite_ecto2 adapter to this one I hit another difference: UUIDs.
Currently this adapter seems to store uuids as strings and the old adapter did opt for the smaller option of raw binary data. I found this one in the testsuite:
ecto_sqlite3/test/ecto/adapters/sqlite3/connection_test.exs
Lines 950 to 951 in 8ff7c8d
I'm wondering if you already decided for one way or the other? It would be really great if this adapter could be switched to using the binary-16 storage. In the embedded world storing data in a more than twice as big format doesn't sound appealing.
I've added the appropriate
loaders/2
anddumpers/2
callback locally to useEcto.UUID
and it seems nothing in the testsuite broke and it made my compatibility check between the adapters work.The text was updated successfully, but these errors were encountered: