Skip to content

Commit

Permalink
remove hood bcz its not database agnostic
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Luiz committed Feb 29, 2024
1 parent 509d98c commit dfe3221
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 24 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@

CLI that generates a go project with the most common stacks of your choice.

## Install
Currently it supports only database agnostic sql code generators (like query builders and so).
Still working on supporting ORM's.

Feel free to contribute to this project!

## Installation

First, make sure that you have Go installed an GOPATH set in your machine.

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.22.0

require (
github.com/buger/goterm v1.0.4
github.com/samluiz/goselcli v0.1.2
github.com/samluiz/goselcli v0.1.4
)

require (
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ github.com/pterm/pterm v0.12.40 h1:LvQE43RYegVH+y5sCDcqjlbsRu0DlAecEn9FDfs9ePs=
github.com/pterm/pterm v0.12.40/go.mod h1:ffwPLwlbXxP+rxT0GsgDTzS3y3rmpAO1NMjUkGTYf8s=
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/samluiz/goselcli v0.1.2 h1:aFLJCk5wvdgTxppkJ68codPvpNsC6DUaf7mDKK0mTDI=
github.com/samluiz/goselcli v0.1.2/go.mod h1:KhFq7ZDHtO90jNtNEC3k0bryKsP7WT4T2EnVwiunAU4=
github.com/samluiz/goselcli v0.1.4 h1:HZ+uEPXOeoNTTY+19QhoRW0upcCALPbr1niifTkGEMM=
github.com/samluiz/goselcli v0.1.4/go.mod h1:KhFq7ZDHtO90jNtNEC3k0bryKsP7WT4T2EnVwiunAU4=
github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down
28 changes: 9 additions & 19 deletions internal/cli/options/sqlcodegens/sqlcodegens.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,50 +12,40 @@ var (
Package: "",
ID: "0",
}
SQLC = SQLCodeGenModule{
Name: "SQLC",
Package: "github.com/kyleconroy/sqlc",
ID: "1",
}
SQUIRREL = SQLCodeGenModule{
Name: "Squirrel",
Package: "github.com/Masterminds/squirrel",
ID: "2",
ID: "1",
}
SQLZ = SQLCodeGenModule{
Name: "SQLZ",
Package: "github.com/ulule/sqlz",
ID: "3",
Package: "github.com/ido50/sqlz",
ID: "2",
}
GOQU = SQLCodeGenModule{
Name: "Goqu",
Package: "github.com/doug-martin/goqu",
ID: "4",
}
HOOD = SQLCodeGenModule{
Name: "Hood",
Package: "github.com/eaigner/hood",
ID: "5",
Package: "github.com/doug-martin/goqu/v9",
ID: "3",
}
)

var SQLCodeGens = []SQLCodeGenModule{
NO_SQL_CODEGEN,
SQLC,
SQUIRREL,
SQLZ,
GOQU,
}

func GetSQLCodeGenModuleById(id string) SQLCodeGenModule {
switch id {
case "0":
return NO_SQL_CODEGEN
case "1":
return SQLC
case "2":
return SQUIRREL
case "3":
case "2":
return SQLZ
case "3":
return GOQU
default:
return SQLCodeGenModule{}
}
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func main() {
versionInfo := GetVersionInfo()
fmt.Print(banner)
if displayVersion {
fmt.Printf("\nversion: %s\ngo Version: %s\n", versionInfo.goinitversion, versionInfo.goversion)
fmt.Printf("\nversion: %s\ngo version: %s\n", versionInfo.goinitversion, versionInfo.goversion)
return
}
cli.Run(os.Stdin)
Expand Down

0 comments on commit dfe3221

Please sign in to comment.