A simple golang tool, that reduces the size of sqlc code generation by replacing Structs that are equal in Field.Names and Field.Types with Type Alias
go install github.com/cubular-io/sqlcube@0.2.1
sqlcube reduce look for a file sqlcube.yaml with source and target folder.
sqlcube reduce
sqlcube generate looks for views,procedures and schema folder, deletes the target folder, and recreates it and copys schema folder, than sums up the views and add it to the target folder as a file called x_views.sql, does the same for z_procedures.
sqlcube generate
sqlcube.yaml
version: "1"
go:
source: "example/sqlc"
target: "example/result"
generation:
views: "example_schema/views"
procedures: "example_schema/procedures"
schema: "example_schema/migrations"
target: "example_schema/sqlc"