entprint

command module
v0.0.0-...-c72592a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 19, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

README

entprint

a tool to print ent schemas as Atlas HCL documents

Docs

From within your Ent project:

go run -mod=mod github.com/rotemtam/entprint --help

Output:

Usage: entprint --dir=STRING --dev=STRING

a tool to print ent schemas as Atlas HCL documents

Flags:
  -h, --help                      Show context-sensitive help.
      --dir=STRING                ent schema directory
      --dev=STRING                dev db url
      --with-global-unique-ids    set global unique ids to true
Example usage

Suppose your Ent schema is located in ./ent/schema, and you have an empty MySQL db running at mysql://root:pass@localhost:3306/test:

go run github.com/rotemtam/entprint  --dir ./internal/example/ent/schema --dev mysql://root:pass@localhost:3306/test

Output:

table "users" {
  schema  = schema.test
  collate = "utf8mb4_bin"
  column "id" {
    null           = false
    type           = bigint
    auto_increment = true
  }
  primary_key {
    columns = [column.id]
  }
}
schema "test" {
  charset = "utf8mb4"
  collate = "utf8mb4_0900_ai_ci"
}
Support

Join us on our Discord server.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL