Is PK automagically create for fields with name ID or UUID? #250
Unanswered
frederikhors
asked this question in
Q&A
Replies: 1 comment 1 reply
-
type Genre struct {
ID int
} Should be working, e.g. see https://github.com/uptrace/bun/blob/master/internal/dbtest/orm_test.go#L432-L441 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm coming from the amazing
go-pg
.I am writing this to understand if I have understood correctly.
With
go-pg
the below struct gives automagically PK and autoincrement (with sequences) in Postgresql:Instead with
bun
I need to write this:Is this correct?
This sounds strange to me because in this page you say:
Why?
Is
pk
automagically create for field with name ID or UUID?Beta Was this translation helpful? Give feedback.
All reactions