Releases: tkcrm/pgxgen
Releases · tkcrm/pgxgen
v0.3.7
v0.3.6
v0.3.5
v0.3.4
v0.3.3
v0.3.2
v0.3.1
v0.3.0
NEW
- Use go ast parser
- Update go keystone models
- Bump sqlc version to 1.26.0
- Update all dependencies
- Generate column names for table
Generate column names for table
Use new param include_column_names
in constants to generate column names for table
constants:
tables:
users:
output_dir: internal/store/repos/repo_users
include_column_names: true
The output will be like this
type ColumnName string
func (s ColumnName) String() string { return string(s) }
func (s ColumnName) StructName() string {
v := stringy.New(string(s)).CamelCase()
v = stringy.New(v).UcFirst()
return strings.ReplaceAll(v, "Id", "ID")
}
const (
ColumnNameUsersId ColumnName = "id"
ColumnNameUsersFirstName ColumnName = "first_name"
ColumnNameUsersLastName ColumnName = "last_name"
ColumnNameUsersCreatedAt ColumnName = "created_at"
)
func UsersColumnNames() []ColumnName {
return []ColumnName{
ColumnNameUsersId,
ColumnNameUsersFirstName,
ColumnNameUsersLastName,
ColumnNameUsersCreatedAt,
}
}