Primary key as string (not UUID)

I have an existing table with a string key. In Ecto, this was generated in the changeset function. In the Ash documentation, there is only integer_primary_key(), and uuid_primary_key(). If I try leaving either of those out, it returns an error that says I need to specify a primary key. How can this be made to work?
5 Replies
dblack
dblack2y ago
Those two are helpers that generate attributes with sensible defaults for primary keys: https://ash-hq.org/docs/dsl/ash-resource#attributes-integer_primary_key
moxley
moxleyOP2y ago
Okay, got it.
dblack
dblack2y ago
You can define your primary key manually without the helpers
moxley
moxleyOP2y ago
Thank you.
dblack
dblack2y ago
No worries

Did you find this page helpful?