Skip to content

Commit

Permalink
keystone and include table columns
Browse files Browse the repository at this point in the history
  • Loading branch information
sxwebdev authored Apr 11, 2024
1 parent b960903 commit 61604b2
Show file tree
Hide file tree
Showing 60 changed files with 1,335 additions and 556 deletions.
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
install:
install: gen
go install ./cmd/pgxgen

upgrade:
Expand All @@ -13,3 +13,9 @@ test:

copysqlc:
go run cmd/copysqlc/main.go

fmt:
gofumpt -l -w .

gen:
@templ generate
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pgxgen use [`sqlc`](https://github.com/sqlc-dev/sqlc) tool with additional impro

### Requirements

- `Go 1.21+`
- `Go 1.22.2+`

```bash
go install github.com/tkcrm/pgxgen/cmd/pgxgen@latest
Expand Down Expand Up @@ -51,7 +51,7 @@ At root of your project create a `pgxgen.yaml`. Example of configuration below.
> Example: `pgxgen --pgxgen-config pgxgen-new.yaml`
```yaml
version: 1
version: "1"
sqlc:
- # directory with migrations. required
schema_dir: sql/migrations
Expand Down Expand Up @@ -125,6 +125,7 @@ sqlc:
tables:
users:
output_dir: internal/store/users/repo_users
include_column_names: true

# modification of existing models. not required
gen_models:
Expand Down Expand Up @@ -293,14 +294,14 @@ At root of your project create a `sqlc.yaml` file with the configuration describ
> Example: `pgxgen --sqlc-config sqlc-new.yaml`

```yaml
version: 2
version: "2"
sql:
- schema: "sql/migrations"
queries: "sql/queries"
engine: "postgresql"
gen:
go:
sql_package: "pgx/v4"
sql_package: "pgx/v5"
out: "internal/store"
emit_prepared_queries: false
emit_json_tags: true
Expand Down
2 changes: 1 addition & 1 deletion cmd/pgxgen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/tkcrm/pgxgen/pkg/logger"
)

var version = "v0.2.9"
var version = "v0.3.0"

func main() {
logger := logger.New()
Expand Down
80 changes: 38 additions & 42 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
module github.com/tkcrm/pgxgen

go 1.21
go 1.22.2

require (
github.com/cubicdaiya/gonp v1.0.4
github.com/davecgh/go-spew v1.1.1
github.com/go-sql-driver/mysql v1.7.1
github.com/go-sql-driver/mysql v1.8.1
github.com/gobeam/stringy v0.0.6
github.com/google/go-cmp v0.6.0
github.com/jackc/pgx/v4 v4.18.1
github.com/jackc/pgx/v4 v4.18.3
github.com/jinzhu/inflection v1.0.0
github.com/lib/pq v1.10.9
github.com/mattn/go-sqlite3 v1.14.18 // indirect
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
github.com/tkcrm/modules v0.0.0-20240108190415-64d66743be2e
golang.org/x/sync v0.6.0
golang.org/x/tools v0.16.1
google.golang.org/protobuf v1.32.0
github.com/tkcrm/modules v0.0.0-20240309201610-ce17a6cd6af6
golang.org/x/sync v0.7.0
golang.org/x/tools v0.20.0
google.golang.org/protobuf v1.33.0
gopkg.in/yaml.v3 v3.0.1
)

Expand All @@ -27,40 +26,39 @@ require (
)

require (
github.com/a-h/templ v0.2.663
github.com/antlr4-go/antlr/v4 v4.13.0
github.com/cristalhq/flagx v0.5.0
github.com/fatih/structtag v1.2.0
github.com/google/cel-go v0.18.2
github.com/jackc/pgx/v5 v5.5.1
github.com/pingcap/tidb/pkg/parser v0.0.0-20240111081109-0236944eab41
github.com/stretchr/testify v1.8.4
github.com/tetratelabs/wazero v1.6.0
github.com/wasilibs/go-pgquery v0.0.0-20240111074841-2809d93c5e23
modernc.org/sqlite v1.28.0
github.com/google/cel-go v0.20.1
github.com/jackc/pgx/v5 v5.5.5
github.com/pganalyze/pg_query_go/v5 v5.1.0
github.com/pingcap/tidb/pkg/parser v0.0.0-20240411124952-572e5c48d98a
github.com/stretchr/testify v1.9.0
github.com/tetratelabs/wazero v1.7.0
github.com/wasilibs/go-pgquery v0.0.0-20240319230125-b9b2e95c69a7
modernc.org/sqlite v1.29.6
)

require (
filippo.io/edwards25519 v1.1.0 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/google/uuid v1.5.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/jackc/puddle/v2 v2.2.1 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/pganalyze/pg_query_go/v5 v5.1.0 // indirect
github.com/pingcap/failpoint v0.0.0-20220801062533-2eaa32854a6c // indirect
github.com/ncruces/go-strftime v0.1.9 // indirect
github.com/pingcap/failpoint v0.0.0-20240411090902-411cc9a77e11 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/stoewer/go-strcase v1.3.0 // indirect
github.com/wasilibs/wazerox v0.0.0-20240105014115-75455786b41e // indirect
golang.org/x/net v0.20.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240108191215-35c7eff3a6b1 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 // indirect
lukechampine.com/uint128 v1.3.0 // indirect
modernc.org/cc/v3 v3.41.0 // indirect
modernc.org/ccgo/v3 v3.16.15 // indirect
modernc.org/libc v1.40.1 // indirect
golang.org/x/net v0.24.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240401170217-c3f982113cda // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect
modernc.org/gc/v3 v3.0.0-20240304020402-f0dba7c97c2b // indirect
modernc.org/libc v1.49.3 // indirect
modernc.org/mathutil v1.6.0 // indirect
modernc.org/memory v1.7.2 // indirect
modernc.org/opt v0.1.3 // indirect
modernc.org/memory v1.8.0 // indirect
modernc.org/strutil v1.2.0 // indirect
modernc.org/token v1.1.0 // indirect
)
Expand All @@ -69,28 +67,26 @@ require (
github.com/cznic/mathutil v0.0.0-20181122101859-297441e03548 // indirect
github.com/go-ozzo/ozzo-validation/v4 v4.3.0
github.com/goccy/go-json v0.10.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
github.com/jackc/pgconn v1.14.1 // indirect
github.com/jackc/pgconn v1.14.3 // indirect
github.com/jackc/pgio v1.0.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgproto3/v2 v2.3.2 // indirect
github.com/jackc/pgproto3/v2 v2.3.3 // indirect
github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 // indirect
github.com/jackc/pgtype v1.14.0 // indirect
github.com/pganalyze/pg_query_go/v4 v4.2.3
github.com/pingcap/errors v0.11.5-0.20210425183316-da1aaba5fb63 // indirect
github.com/jackc/pgtype v1.14.3 // indirect
github.com/pingcap/errors v0.11.5-0.20240311024730-e056997136bb // indirect
github.com/pingcap/log v1.1.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/riza-io/grpc-go v0.2.0
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/crypto v0.18.0 // indirect
golang.org/x/exp v0.0.0-20240110193028-0dcbfd608b1e // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/sys v0.16.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/exp v0.0.0-20240409090435-93d18d7e34b8 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/grpc v1.60.1
google.golang.org/grpc v1.63.2
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
)
Loading

0 comments on commit 61604b2

Please sign in to comment.