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
Since the underlying data type in postgres is uuid DB clients render the ULID as a UUID. I can query using the DB client fine with these IDs, but how do I query for records from within iex
eg. iex(2)> MyApp.Repo.get!(Blog, "<TBD>") I tried a couple of encoding/decoding ideas, but I'm drawing a blank.
The text was updated successfully, but these errors were encountered:
If you're talking about a UUID received from a non-Elixir DB client, the way to go about this is to use Ecto.UUID.dump/1 first. So, given a UUID representation of a ULID 018f7ad0-d3da-6a9c-61de-b883f459a3a1:
If you're going to be doing this a lot, it might make sense to fork this project and customize Ecto.ULID.cast/1 so it also accepts and validates a ULID-conformant UUID.
Since the underlying data type in postgres is
uuid
DB clients render the ULID as a UUID. I can query using the DB client fine with these IDs, but how do I query for records from withiniex
eg.
iex(2)> MyApp.Repo.get!(Blog, "<TBD>")
I tried a couple of encoding/decoding ideas, but I'm drawing a blank.The text was updated successfully, but these errors were encountered: