Code generated from a table with no primary key does not compile:
db/schema/subnet.go:10: imported and not used: "fmt"
db/schema/subnet.go:31: cannot use 0 (type int) as type Subnet in return argument
The first error is that the fmt package is only used in a section of the template included if the table has a primary key.
The second error is that 0 is being returned as a dummy value instead of nil. Solution here is probably to not generate the Get method at all if it isn't going to work with no primary key.
Code generated from a table with no primary key does not compile:
The first error is that the fmt package is only used in a section of the template included if the table has a primary key.
The second error is that 0 is being returned as a dummy value instead of nil. Solution here is probably to not generate the Get method at all if it isn't going to work with no primary key.