Configuring generated structs
Naming scheme
Structs generated from tables will attempt to use the singular form of a table name if the table name is pluralized.
CREATE TABLE authors (
id SERIAL PRIMARY KEY,
name text NOT NULL
);
package db
// Struct names use the singular form of table names
type Author struct {
ID int
Name string
}
More control
See the Type Overrides section of the Configuration File docs for fine-grained control over struct field types and tags.