Commit Graph

37 Commits

Author SHA1 Message Date
Michael Caulley
6813cdd337 fix: set the dialect for the generated query (#4349)
different quote characters are used by different dialects
2025-03-12 14:04:42 +01:00
Jannik Clausen
addae7fc6f cmd/internal/base: add build tags flag to schema dump command (#4339) 2025-02-24 12:46:24 +01:00
Jannik Clausen
8b85c83e00 dialect/sql/schema: add multi schema and view support for schema dump (#4335) 2025-02-21 15:16:17 +01:00
Jannik Clausen
da9f897368 cmd/entfix: rename entfix module to be aligned with other ent commands (#4328) 2025-02-12 17:00:23 +01:00
Jannik Clausen
4478d3ccb3 cmd/entfix: add utility binary entfix (#4306)
* cmd/entfix: add utility binary entfix

First command is 'entfix globalid' which will convert an existing ent_types table to the globalid ent feature.

* CR
2025-01-20 15:07:31 +01:00
Jannik Clausen
f7fed7316b cmd/ent: exit code 1 on error (#4307) 2025-01-20 10:21:47 +01:00
Jannik Clausen
05c977357f dialect/sql/schema: add schema dump command (#4296)
* dialect/sql/schema: add schema dump command

* entc/gen/template: drop build flag from generated globalid.go
2025-01-15 16:24:02 +01:00
Ariel Mashraki
0508677ce7 cmd/ent: hide the --idtype flag from generate command (#3490)
The --idtype flag predates the field.<Type>(id) option.
See, https://entgo.io/docs/schema-fields\#id-field.
2023-04-18 15:54:14 +03:00
Noam Cattan
d143432580 doc: replace diagram examples links (#3435)
* cmd/internal: fix help message for "new" command

* doc: replace example links
2023-04-03 16:38:57 +03:00
Ariel Mashraki
3f1063c77e schema/field: add support or external ValueScanner (#3391) 2023-03-16 22:18:54 +02:00
Travis Cline
4abb259989 cmd/ent: Attach Funcs for ent new templates (#3336) 2023-02-21 06:57:31 +02:00
Rotem Tamir
102f60ac12 cmd/internal/base: fix type on print sub-command (#3335) 2023-02-20 13:52:09 +02:00
Giau. Tran Minh
f4bdc36e85 cmd/ent: rename init to new (#3311)
* cmd: rename init to new

Signed-off-by: Giau. Tran Minh <hello@giautm.dev>

* doc: update guide to use new command

Signed-off-by: Giau. Tran Minh <hello@giautm.dev>

---------

Signed-off-by: Giau. Tran Minh <hello@giautm.dev>
2023-02-12 13:56:18 +02:00
nzlov
942eb56b2a cmd/ent: add comments to 'describe' command (#3067) 2022-11-07 16:23:07 +02:00
Ariel Mashraki
4425d1a6e1 cmd/ent: support 'ent describe' in edge-schemas (#2931) 2022-09-15 11:09:15 +03:00
Ariel Mashraki
2c63d1d70e all: gofmt -w -r 'interface{} -> any' (#2874) 2022-08-19 18:23:04 +03:00
Daniel Huckins
f9dfac628b cmd/ent: add support for --template in init command (#2728)
* allow init cmd to have a template file or string

* add example

* dead code

* only use path

* Apply suggestions from code review

Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>

* fix lint

Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>
2022-07-27 21:23:08 +03:00
MasseElch
0239daca7b dialect/sql/schema: versioned migrations (#2337)
* dialect/sql/schema: fix go doc

* all: update atlas

* dialect/sql/schema: diff connected DB and defined schema and write changes to migration file

* dialect/sql/schema: use migration directory and formatter directly instead of a planner

* all: update atlas

* cmd: add command to create a new migration file

* entc/gen: generate main.go with migrate diff example

* all: regenerate

* cmd/internal/base: make linter happy

* all: support Go 1.16 in versioned migrations main.go

* entc/gen: put versioned migrations behind feature flag

* all: regenerate

* cmd/ent: driver-prefixed dsn in migrate diff command

* cmd/internal/base: remove prefix from migrate import

* cmd/internal/base: use cobra.CheckErr

* cmd: remove diff command

* entc/gen/template/dialect/sql/feature: remove generated main.go

* all: rebase on master and go mod tidy

* all: regenerate
2022-02-21 12:15:17 +02:00
Andy Day
2e906bffa2 cmd/ent: Add check that model file doesn't already exist on ent init (#2307)
Previously if you run  it would overwrite an existing file  if that already existed. Now  checks if that file already exists, and returns an error if so.
2022-02-03 01:44:04 +02:00
Ariel Mashraki
11843ff867 go: upgrade to 1.17 2021-08-21 00:14:22 +03:00
森 優太
e52439c5be cmd/ent: fix //go:generate code generation to match go1.16 (#1300)
* doc: fix github link

* doc: fix Link entgo.io -> github.com/ent

* 🎉 first commit

* update go generate style

* doc: update go get to go install

* doc: update versioning with go install

* restore all

* change generate.go content

* add -mod=mod option

* add -mod=mod option
2021-03-09 22:00:33 +02:00
Matthew Gabeler-Lee
c53b45ddb0 all: use %w instead of %v to wrap errors (#1275)
* all: use %w instead of %v for nested errors with fmt.Errorf

* all: update generated code to use %w instead of %v for error wrapping
2021-03-03 20:05:33 +02:00
Ariel Mashraki
dd4792f5b3 go: rename module from github.com/facebook/ent => entgo.io/ent (#1226) 2021-02-02 23:03:04 +02:00
Nathaniel Peiffer
cfefd26543 cmd/internal/base: add name conflict check for init command (#1110)
* adds checks for name conflicts
also tidies up error handling inside init

* fix failing test, check for lower name for golang idents

* update function name and prefer builtin function

* pkg instead of lowerName
2021-01-02 22:25:39 +02:00
Nathaniel Peiffer
e37995be31 cmd/internal/base: more informative comment (#1116) 2021-01-02 09:29:47 +02:00
Ariel Mashraki
b77d2d4277 cmd/ent: replace entc with ent (#989)
See #981
2020-11-29 10:23:24 +02:00
Ariel Mashraki
6cf2271c1b entc/gen: initial version for feature-flags (#803) 2020-09-29 16:22:50 +03:00
Ariel Mashraki
fd0a7f9f02 all: facebookincubator/ent => facebook/ent (#660)
ent repository is going to be migrated to facebook organization
2020-08-18 11:05:08 +03:00
Alex Snast
2fc6b276ee entc: adding template type option to --template flag (#488)
* entc: adding template type option to --template flag

Signed-off-by: Alex Snast <alexsn@fb.com>

* golangci: update funlen config

* cmd/entc: remove timestamp from logging

Co-authored-by: Ariel Mashraki <ariel@mashraki.co.il>
2020-05-12 12:19:14 +03:00
Ariel Mashraki
de5006a4d8 entc/gen: lazy compute storage-driver queries (#408) 2020-03-29 14:36:44 +03:00
Ariel Mashraki
a2ea5bfbee cmd/entc: add generate.go file to env init (#402)
* cmd/entc: add generate.go file to env init

* doc: update getting-started and codegen documentation
2020-03-24 19:23:30 +02:00
Ariel Mashraki
bb852ad093 intgeration: add pg and mysql test for customids (#342) 2020-02-12 20:42:03 +02:00
Ariel Mashraki
e85b10be36 entc/gen: remove multi storage support 2019-12-15 14:48:55 +02:00
Ariel Mashraki
0344904a4e cmd/entc: support custom target on codegen (#189)
Summary:
Pull Request resolved: https://github.com/facebookincubator/ent/pull/189

Fixes #61

Reviewed By: alexsn

Differential Revision: D18676988

fbshipit-source-id: 00d415e14d1278a45edea49c69abe4916303f55d
2019-11-24 08:06:08 -08:00
Ariel Mashraki
e6c6442c84 cmd/entc: load package path for arbitrary file paths (#186)
Summary:
Pull Request resolved: https://github.com/facebookincubator/ent/pull/186

This is an ongoing work for fixing #61 (Github issue)

Reviewed By: alexsn

Differential Revision: D18672982

fbshipit-source-id: 12051d7b06d87d73d37b68382566732e532193e3
2019-11-24 07:11:23 -08:00
Ariel Mashraki
e161ecc29c cmd/entc: remove graph printing from generator
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/163

Reviewed By: alexsn

Differential Revision: D18503829

fbshipit-source-id: 1269d4c8c30f848c5096258f2328230f5f378f69
2019-11-14 08:21:30 -08:00
Ariel Mashraki
7597f07912 entc: add option to use entc as package
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/72

Reviewed By: alexsn

Differential Revision: D17783580

fbshipit-source-id: 597f124a28415fef66b0b16811ad2acac8df631d
2019-10-07 07:06:32 -07:00