-
Notifications
You must be signed in to change notification settings - Fork 189
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
feat(cli): user types and route/path separation #454
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to verify my understanding:
- Currently the only supported type of user type is "Enum"
- The schema is not impacted by user types, user types are handled as
uint8
in field values, and therefore no changes are needed for decoding updates on the indexer or client - Currently only the autogenerated Solidity table libraries care about user types (in the function signatures, for encoding/decoding, and for the return type)
- In a follow up PR we can add autogenerated typescript enums and similar auto-generated wrappers around the client decoders to turn the
uint8
values into Enums
Correct?
This is a very useful addition to the autogenerated libraries. You mentioned you expect this to pave the way for foreign keys, could you elaborate a bit on this?
I think we should merge this asap, before #467, because it touches a lot of the same code
Co-authored-by: alvarius <[email protected]>
yes
yes
yes
yes
these aren't strictly sequential things, but the idea is when I make table relationships, user types can be used for:
|
Codegen gets userTypes, which are a first-class type interchangeable with SchemaType. So far the only userType kind is
enums
.The specifics of
userTypes
config option are still very volatile and will likely change in future PRs.Enums as primary keys seem pointless, but this paves the way for entities and relational types