-
Notifications
You must be signed in to change notification settings - Fork 17
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
16 character string converted to UUID #9
Comments
And just to add another data point, it appears the same in Postgres:
|
It just happens that such binaries are valid UUID as well. We simply try to guess the Ecto type by Elixir type, as we don't have other metadata in telemetry. Such approach doesn't work well for all scenarios. I assume, the issue will be resolved when elixir-ecto/ecto#3869 is done, so we wouldn't have to guess uuids in this library. |
Thanks @fuelen. That makes sense. 👍 |
|
Just an FYI, I ran into this today when using the string "America/New_York", a common time zone identifier. |
I just started playing with Ecto.DevLogger again and went through the issues and this paragraph has been mildly bugging me. This project is still in the As I also store time zone strings in the database, I think it would be worthwhile seeing this improvement to prevent the |
I wanted to make a major change and to initiate changes in ecto, so we can do precise logging https://groups.google.com/g/elixir-ecto/c/5AwUoaEuq4E/m/J9Kbr9FOBAAJ?pli=1 but seems like this won't be possible, only guessing. |
with the function introduced in #33 it's a matter of extending the [[hex | _], [uuid | _] = uuids] when byte_size(hex) == 16 and byte_size(uuid) == 36 -> uuids
[hex, uuid] when byte_size(hex) == 16 and byte_size(uuid) == 36 -> uuid |
Hi, Thanks again for this project!
There seems to be something not quite right around converting parameters to UUIDs. All 16 character strings seem to get converted into UUIDs.
Running the SQL in the log doesn't result in the same output as the query in Ecto.
I've had a look at the code and I'm not sure what can be done about this. By the time dev_logger sees the parameter there is no longer any information to help it to understand the schema, so it's making the assumption that all 128 bit bitstrings are UUIDs, but that also matches 16 character strings.
The text was updated successfully, but these errors were encountered: