Differences between UUID primary keys in Ecto vs Ash
As far as I can tell, the Ash Resource special attribute
Echo's migration file looks like:
Ash's migration file looks like:
I'm not entirely sure if the functionality will all be the same at the end of the day. Reading docs and source code, it seems like Postgrex treats
The most surprising is the
The reason I'm worried about it is because I'm interested in using UUIDv7 for my PKs. That function may never run if generating UUIDs in Elixir-land, but it seems off to be there.
uuid_primary_key unwraps into:Ash.UUID.generate/0 seems to be a passthrough to Ecto.UUID.generate(). What I found unexpected was the migration files.Echo's migration file looks like:
Ash's migration file looks like:
I'm not entirely sure if the functionality will all be the same at the end of the day. Reading docs and source code, it seems like Postgrex treats
:binary, :binary_id, and :uuid similarly when ran by Ecto SQL, but I'm not sure.The most surprising is the
:default option in Ash's implementation. It hard-codes a Postgres DB function as a default value even though :primary_key option is set (which I think inherently makes the field non-nullable in most databases.The reason I'm worried about it is because I'm interested in using UUIDv7 for my PKs. That function may never run if generating UUIDs in Elixir-land, but it seems off to be there.
