MCPcopy
hub / github.com/sqlc-dev/sqlc / SetCaseStyle

Function SetCaseStyle

internal/codegen/golang/field.go:54–65  ·  view source on GitHub ↗
(name string, style string)

Source from the content-addressed store, hash-verified

52}
53
54func SetCaseStyle(name string, style string) string {
55 switch style {
56 case "camel":
57 return toCamelCase(name)
58 case "pascal":
59 return toPascalCase(name)
60 case "snake":
61 return toSnakeCase(name)
62 default:
63 panic(fmt.Sprintf("unsupported JSON tags case style: '%s'", style))
64 }
65}
66
67func SetJSONCaseStyle(name string, style string, idUppercase bool) string {
68 switch style {

Callers 1

columnsToStructFunction · 0.85

Calls 3

toCamelCaseFunction · 0.85
toPascalCaseFunction · 0.85
toSnakeCaseFunction · 0.85

Tested by

no test coverage detected