Releases: nvcnvn/sqlc-gen-go-crud
Releases · nvcnvn/sqlc-gen-go-crud
new helper methods for table schema
Generate 3 new methods for each struct: TableName, Fields, and FieldsMap
type TestTable struct {
ID pgtype.UUID `json:"id"`
}
func (s *TestTable) TableName() string {
return "public.test_table"
}
func (s *TestTable) Fields() ([]string, []any) {
return []string{
"id",
}, []any{
&s.ID,
}
}
func (s *TestTable) FieldsMap() map[string]any {
return map[string]any{
"id": &s.ID,
}
}