Skip to content

A golang code, that reduces the size of sqlc code generation by replacing Structs that are equal in Field.Names and Field.Types with Type Alias

Notifications You must be signed in to change notification settings

cubular-io/sqlcube

Repository files navigation

sqlcube

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

Install

 go install github.com/cubular-io/sqlcube@0.2.1

Use

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

Example Yaml

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"

About

A golang code, that reduces the size of sqlc code generation by replacing Structs that are equal in Field.Names and Field.Types with Type Alias

Resources

Stars

Watchers

Forks

Packages

No packages published