Skip to content

Commit

Permalink
Merge pull request #6 from minskylab/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
bregydoc authored Jan 17, 2022
2 parents 19ac6fd + 357a67f commit 0be62d0
Show file tree
Hide file tree
Showing 35 changed files with 3,578 additions and 275 deletions.
319 changes: 115 additions & 204 deletions apply.go

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions cmd/ent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func main() {
stringFlag("source", "c", "default"),
stringFlag("envfile", "e", ".env"),
stringFlag("configfile", "f", ""),
boolFlag("debug", "d", false),
},
Action: applyCommand,
},
Expand Down Expand Up @@ -97,7 +98,14 @@ func generateCommand(c *cli.Context) error {

func applyCommand(c *cli.Context) error {
envFile := c.String("envfile")
logrus.Info(envFile)
debug := c.Bool("debug")

if debug {
logrus.SetLevel(logrus.DebugLevel)
}

logrus.Debugf("loadenv: %s\n", envFile)

run, err := hasura.NewEphemeralRuntime(
hasura.WithEnvFilepath(envFile),
)
Expand All @@ -113,7 +121,7 @@ func applyCommand(c *cli.Context) error {
schema = schemaOverride
}

run.ApplyPGTableCustomizationForAllTables(schema, name, source)
run.ApplyPGFullProcessForAllTables(schema, name, source)

return nil
}
131 changes: 130 additions & 1 deletion example/basic/ent/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions example/basic/ent/config.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions example/basic/ent/ent.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion example/basic/ent/generate.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ent

//go:generate go run -mod=mod entgo.io/ent/cmd/ent generate ./schema
//go:generate go run github.com/minskylab/ent-hasura/cmd/ent apply -e ../.env ./schema
//go:generate go run github.com/minskylab/ent-hasura/cmd/ent apply -d -e ../.env ./schema
13 changes: 13 additions & 0 deletions example/basic/ent/hook/hook.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0be62d0

Please sign in to comment.