Ariel Mashraki
ed783dba70
dialect/sql/sqlgraph: support edge-schema in upsert ( #2714 )
2022-07-03 23:29:35 +03:00
Giau. Tran Minh
4f7b1739cd
entc: cleanup defaults ID ( #2709 )
2022-07-01 23:30:18 +03:00
Ariel Mashraki
904b649120
entc/gen: skip nodes with composite id types on default id-type detection ( #2708 )
...
Was reported on Discord
2022-07-01 23:08:45 +03:00
Ariel Mashraki
4a26cab734
improve multi-tenancy example and documentation ( #2705 )
...
* example/privacytenant: support edge-field and improve code examples
* md/privacy: improve multi-tenancy documentation
2022-06-30 19:57:56 +03:00
Ariel Mashraki
7cac3b2ed5
entc/gen: support default id values for edge schemas ( #2688 )
2022-06-25 20:23:43 +03:00
Ariel Mashraki
6ddeb93649
entc/gen: use gotypw pkgname as alias in case it does not match pkgpath ( #2686 )
2022-06-25 11:05:15 +03:00
Ariel Mashraki
311d760679
entc/gen: allow opening and testing concurrent enttest clients ( #2665 )
2022-06-20 08:32:30 +03:00
Ariel Mashraki
abefaa7f24
entc/gen: catch constraint failures in delete operations ( #2664 )
2022-06-19 14:34:32 +03:00
Giau. Tran Minh
195be2d98d
entc/gen: fixed unnamed field initialization ( #2648 )
...
* entc/gen: fixed ConstraintError fields name
* fix: run go generate
* entc/gen: fixed Filter fields name
* fix: run go generate again for entql
2022-06-14 12:32:46 +03:00
Will Bicks
cd1afb235c
entc: improve generated comments for edges and fields ( #2632 )
...
* replace default field comment with user comment if defined
* use comments defined on edges in generated entities
* add docs for comment method on edges and fields
* update integration to reflect above changes
2022-06-13 15:52:47 +03:00
hax10
e6152856b1
entc/gen: fix name clash in entc template when entity name has initials as tx ( #2633 )
2022-06-09 20:39:46 +03:00
Ariel Mashraki
fd955654a0
entc/gen: change codegen signature from entc to ent ( #2627 )
2022-06-07 17:48:17 +03:00
Ariel Mashraki
e634960221
entc/gen: move a8m/entclean logic to ent ( #2612 )
2022-06-05 14:31:45 +03:00
Ariel Mashraki
c26d92d39e
entc/gen: support indexing edge schema with composite primary keys ( #2578 )
2022-05-30 17:20:27 +03:00
Giau. Tran Minh
0917701f91
entc/gen: fix wrong UserDefined checks in templates ( #2572 )
2022-05-28 12:12:57 +03:00
Ariel Mashraki
5800f6b578
entc/gen: avoid setting the incremental attribute fo non-integer fields ( #2571 )
2022-05-27 23:54:41 +03:00
Ariel Mashraki
e1c5277483
ent: initial support for edge schemas ( #2560 )
2022-05-25 15:46:00 +03:00
Ariel Mashraki
f2e0bef7a8
entc/gen: add conditional-write option to external templates ( #2542 )
2022-05-12 07:36:15 +03:00
Justin Johnson
38d4d5fb5c
entc/gen: propagate nodes post-save mutations ( #2525 )
...
* Failing test
* Fix propagating entirely models from OpCreate hook
* Apply suggestions from code review
Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com >
* whitespace
* Failing test for updateone
* fix for updateone
* Regnerate
* regen from root
Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com >
2022-05-05 11:19:21 +03:00
MasseElch
51f293fc54
entc/gen/template/sql/feature: add comment to feature field on config… ( #2515 )
...
* entc/gen/template/sql/feature: add comment to feature field on config and remove blank line
* all: go generate
2022-05-02 14:29:53 +03:00
MasseElch
4e434b2b73
gen/template: allow overriding of client struct and initialization ( #2503 )
2022-04-28 09:07:44 +02:00
MasseElch
2c8e58ce94
entc/gen: skip Table() predicate and warn about reserved schema name (Client) ( #2486 )
...
* entc/gen: do no generate `Table()` predicate and warn the user in case of reserved schema name like `Client`.
* doc/md: document reserved schema name
* doc/md: revert reserved schema name as this was already working
* doc/md: rephrase
2022-04-20 16:30:59 +02:00
Ariel Mashraki
4cf6dd75ec
entc/gen: expose config on generated filters ( #2473 )
2022-04-14 20:00:52 +03:00
Ariel Mashraki
89c339209e
entc/gen: add the sql/execquery feature flag ( #2447 )
2022-04-06 13:34:22 +03:00
Ariel Mashraki
05246cbd26
gen/entc/template: add option to process nodes after query using external templates ( #2444 )
2022-04-02 22:01:28 +03:00
Giau. Tran Minh
196875c761
entc/gen: block Optional on ID fields ( #2443 )
...
* entc/gen: block Optional on the ID field
* chore: restore the old error message
* Update entc/gen/type.go
Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com >
Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com >
2022-04-02 21:01:38 +03:00
Ariel Mashraki
345d3d1783
dialect/sql: support for order by expressions in window functions ( #2442 )
2022-04-01 21:31:00 +03:00
Ariel Mashraki
48bb70f056
entc/gen: allow adding extra fields to the generated edges ( #2437 )
2022-03-29 14:54:16 +03:00
Ariel Mashraki
edd968490e
entc/gen: use join for loading m2m relationship ( #2417 )
...
* entc/gen: use join for m2m relationship
* entc/gen: add test for eager-load inverse-m2m
2022-03-21 11:37:54 +02:00
Ariel Mashraki
a7c1df2d0a
entc/gen: move selectbuilder scan functions to shared struct ( #2412 )
2022-03-18 07:59:04 +02:00
Ariel Mashraki
c071898395
entc/gen: move column default quoting to template ( #2406 )
2022-03-16 13:41:19 +02:00
MasseElch
2853afc1dc
dialect/sql/schema: add method to create a named versioned migration … ( #2385 )
...
* dialect/sql/schema: add method to create a named versioned migration file
* doc/md: documentation for named versioned migrations
* entc/gen/template/dialect/sql/feature: add NamedDiff method to create named versioned migration files
* all: go generate
* doc/md: apply CR
2022-03-10 16:40:57 +01:00
Ariel Mashraki
0c7679e571
entc/gen: set Ref and Inverse for edge contains both From and To
2022-03-08 22:28:50 +02:00
Ariel Mashraki
fe2511fc8d
dialect/entsql: add support for index-type annotation
2022-02-22 16:24:30 +02:00
MasseElch
d80f7cc41a
entc/gen: singularize feature flag name for versioned migrations ( #2350 )
2022-02-21 20:06:32 +01: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
Pedro Henrique
24a7e78d49
entc/gen: skip assertion on edges with type Other ( #2335 )
2022-02-18 00:37:16 +02:00
MrParano1d
a75e9c5a8f
entc/gen: fix missing unique field in query builder template ( #2332 )
...
* fix(query): fix missing unique field in query builder template
when a query gets cloned the unique field doesn't get cloned
#2331
* fix(query): added missing go generate ./...
#2331
* fix(query): added missing go generate ./...
#2331
2022-02-15 22:31:05 +02:00
Pedro Henrique
f45d29ba4b
entc/gen: allow if field to use field.Other with custom types ( #2309 )
...
* fix ID with field.Other comparing with zero
* fix lint
* Update entc/integration/customid/ent/schema/other.go
Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com >
* re-generate code
Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com >
2022-02-10 16:17:16 +02:00
Ariel Mashraki
770e4d24e9
entc/gen: add Type.IsInt64 helper function for fields
2022-02-04 22:46:17 +02:00
Ariel Mashraki
1d3f1819ae
entc/gen: replace Type.Alias with Type.PackageAlias
2022-02-04 22:46:17 +02:00
Ariel Mashraki
0e49dd1d9f
entc/gen: support local package names for generated packages
...
The new Alias option adds package aliases (local names) for all type-packages that
their import identifier conflicts with user-defined packages (i.e. GoType).
2022-02-02 15:50:00 +02:00
Ariel Mashraki
94499bd141
dialect/entsql: add support for DESC indexes annotation
2022-01-31 15:18:09 +02:00
Ariel Mashraki
898991ac79
entc/gen: set foreign-key columns non-nullable for required edges ( #1703 )
...
Note, this only applies to edges without circular references.
Fixed #1688 and #1374
2022-01-23 22:23:37 +02:00
Nicholas Anderson
896f2b202d
entc/gen: update NotSingularError godoc ( #2274 )
...
* fix: update only/onlyID comments
this patch updates the Only/OnlyID methods in the builder template from:
> // Returns a *NotSingularError when exactly one {{ $.Name }} entity is not found.
to
> // Returns a *NotSingularError when more than exactly one {{ $.Name }} ID is found.
in an effort to be more explicit in the explanation of the behavior of the methods.
* fix: update wording to be more concise from suggestion
Co-authored-by: Rotem Tamir <rotemtamir@gmail.com >
* fix: update Only wording to be more concicse
* fix: generate new files
Co-authored-by: Rotem Tamir <rotemtamir@gmail.com >
2022-01-23 19:07:10 +02:00
Clarence
eca70b8490
schema/field: array types are nillable ( #2266 )
...
* all: type fixes
* schema/field: remove array check from goType
2022-01-13 13:39:11 +02:00
Genevieve
16e57a92c5
entc/gen: spelling fix in error message ( #2262 )
2022-01-13 12:51:37 +02:00
Roman Maklakov
84070a0f07
entc/gen: add ctx in client.BeginTx ( #2260 )
...
* doc: fix docker-compose up command(#2253 )
* entc/gen: add ctx in TxBegin & run go generate (#2253 )
* entc/integration: add tests for TxBegin Commit and Rollback (#2253 )
* entc/integration: uncomment accidentally commented code(#2253 )
* entc/integration: fixes after code-review (#2253 )
* entc/integration: remove blank lines, code-review (#2253 )
* examples: run code gen (#2253 )
2022-01-12 14:28:55 +02:00
Sasha Melentyev
f5fed28782
all: fix typos ( #2243 )
...
* refactor(all): Fix typo and small refactor
* refactor(all): Fix typo
2022-01-05 16:10:28 +02:00
MasseElch
84ca961938
entc/gen: there was a typo in Ty interfaces ( #2251 )
2022-01-05 16:09:48 +02:00