-
Notifications
You must be signed in to change notification settings - Fork 923
Stronger typing for columns/fields in Go #3174
Unanswered
ptman
asked this question in
Feature Requests & Ideas
-
Hi,
Type safety is nice. Having the computer catch more bugs is nice. Is anyone else doing something like this:
CREATE TABLE users (user_id bigint GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY);
package types type UserID int64
version: '2' sql: - gen: go: overrides: - column: 'users.user_id' go_type: import: 'types' type: 'UserID'
This gives types to e.g. ID columns, so that you don't accidentally assign one bigint/int64 ID column to another, mixing tables/relations.
Is anyone else doing something similar? Can this be made easier? More automated?
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment