just rename internal/dao/slonik/ce => internal/dao/slonik/sqlc

r/paopao-ce-pro
Michael Li 2 years ago
parent 3926b4297d
commit a5eb148ee9
No known key found for this signature in database

@ -84,9 +84,9 @@ gen-grpc:
.PHONY: gen-sqlc .PHONY: gen-sqlc
gen-sqlc: gen-sqlc:
@find internal/dao/slonik/ce/postgres -name '*.go' -exec rm -f {} + @find internal/dao/slonik/sqlc/postgres -name '*.go' -exec rm -f {} +
@go generate internal/dao/slonik/ce/gen.go @go generate internal/dao/slonik/sqlc/gen.go
@go fmt ./internal/dao/slonik/ce/... @go fmt ./internal/dao/slonik/sqlc/...
.PHONY: proto-mod .PHONY: proto-mod
proto-mod: proto-mod:

@ -122,7 +122,7 @@ require (
github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasthttp v1.37.1-0.20220607072126-8a320890c08d // indirect github.com/valyala/fasthttp v1.37.1-0.20220607072126-8a320890c08d // indirect
go.uber.org/atomic v1.9.0 // indirect go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.8.0 // indirect go.uber.org/multierr v1.9.0 // indirect
go.uber.org/zap v1.21.0 // indirect go.uber.org/zap v1.21.0 // indirect
golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect
golang.org/x/crypto v0.6.0 // indirect golang.org/x/crypto v0.6.0 // indirect

@ -1356,8 +1356,8 @@ go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/
go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak=
go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI=
go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ=
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=

@ -11,5 +11,5 @@ import (
"embed" "embed"
) )
//go:embed ce/postgres/schema //go:embed sqlc/postgres/schema
var Files embed.FS var Files embed.FS

@ -10,7 +10,7 @@ import (
"github.com/jackc/pgx/v5" "github.com/jackc/pgx/v5"
"github.com/rocboss/paopao-ce/internal/conf" "github.com/rocboss/paopao-ce/internal/conf"
dbr "github.com/rocboss/paopao-ce/internal/dao/slonik/ce/postgres" dbr "github.com/rocboss/paopao-ce/internal/dao/slonik/sqlc/postgres"
) )
var ( var (

@ -12,7 +12,7 @@ import (
"github.com/jackc/pgx/v5" "github.com/jackc/pgx/v5"
"github.com/rocboss/paopao-ce/internal/core" "github.com/rocboss/paopao-ce/internal/core"
"github.com/rocboss/paopao-ce/internal/core/cs" "github.com/rocboss/paopao-ce/internal/core/cs"
dbr "github.com/rocboss/paopao-ce/internal/dao/slonik/ce/postgres" dbr "github.com/rocboss/paopao-ce/internal/dao/slonik/sqlc/postgres"
) )
var ( var (

@ -72,7 +72,7 @@ func Run() {
} }
} else if cfg.If("Sqlc") { } else if cfg.If("Sqlc") {
if cfg.If("PostgreSQL") || cfg.If("Postgres") { if cfg.If("PostgreSQL") || cfg.If("Postgres") {
srcDriver, err = iofs.New(slonik.Files, "ce/postgres/schema") srcDriver, err = iofs.New(slonik.Files, "sqlc/postgres/schema")
dbDriver, err2 = postgres.WithInstance(db, &postgres.Config{MigrationsTable: migrationsTable}) dbDriver, err2 = postgres.WithInstance(db, &postgres.Config{MigrationsTable: migrationsTable})
} }
} }

Loading…
Cancel
Save