File tree Expand file tree Collapse file tree 3 files changed +6
-1
lines changed
Expand file tree Collapse file tree 3 files changed +6
-1
lines changed Original file line number Diff line number Diff line change 55 "fmt"
66 "github.com/bitquery/protobuf-sql/compiler/protogen"
77 "github.com/bitquery/protobuf-sql/reflect/protoreflect"
8+ "github.com/gertd/go-pluralize"
89 "github.com/stoewer/go-strcase"
910 "html/template"
1011 "strings"
@@ -165,5 +166,6 @@ func fileName(messageName, suffix string) string {
165166}
166167
167168func tableName (messageName , suffix string ) string {
168- return strcase .SnakeCase (strings .TrimSuffix (messageName , suffix )) + "s"
169+ singular := strcase .SnakeCase (strings .TrimSuffix (messageName , suffix ))
170+ return pluralize .NewClient ().Plural (singular )
169171}
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ module github.com/bitquery/protobuf-sql
33go 1.17
44
55require (
6+ github.com/gertd/go-pluralize v0.2.1
67 github.com/golang/protobuf v1.5.3
78 github.com/google/go-cmp v0.5.9
89 github.com/stoewer/go-strcase v1.2.1
Original file line number Diff line number Diff line change 11github.com/davecgh/go-spew v1.1.0 /go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38 =
22github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c =
33github.com/davecgh/go-spew v1.1.1 /go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38 =
4+ github.com/gertd/go-pluralize v0.2.1 h1:M3uASbVjMnTsPb0PNqg+E/24Vwigyo/tvyMTtAlLgiA =
5+ github.com/gertd/go-pluralize v0.2.1 /go.mod h1:rbYaKDbsXxmRfr8uygAEKhOWsjyrrqrkHVpZvoOp8zk =
46github.com/golang/protobuf v1.5.0 /go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk =
57github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg =
68github.com/golang/protobuf v1.5.3 /go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY =
You can’t perform that action at this time.
0 commit comments