Giau. Tran Minh
088bfd75ad
entc/gen/template: allow nested template access Receiver ( #4354 )
2025-03-17 17:16:05 +07:00
Ariel Mashraki
7284481be5
entc/gen: add feature-flag to set unique backref when their inverse is loaded ( #3953 )
2024-02-24 22:57:17 +02:00
Ariel Mashraki
e8a2548915
entc/gen: allow naming ent/schemas as builder ( #3593 )
2023-06-09 01:16:56 +03:00
Ariel Mashraki
6198beb484
entc/gen: load referenced foreign-keys on eager-loading ( #3497 )
2023-04-20 17:26:37 +03:00
Ariel Mashraki
065cb9f9ff
entc/gen: avoid ambiguous column names when joining the same table ( #3461 )
2023-04-10 06:29:17 +03:00
Ariel Mashraki
ba7f158a9c
entc/gen: allow scanning dynamic sql values ( #3432 )
2023-04-03 17:07:24 +03:00
Ariel Mashraki
c35f786f86
entc/gen: ensure edge-fields are selected when their edges are loaded ( #3401 )
2023-03-20 19:11:04 +02:00
Ariel Mashraki
939c7cff1a
entc/gen: reduce the usage of DISTINCT in queries ( #3305 )
...
Most queries are not graph traversals but rather regular table scans,
in which case the DISTINCT clause is not needed as duplicates cannot be
returned (unless query was modified by the user).
2023-02-06 22:40:50 +02:00
sisterdong
c9445d2794
entc/gen: make interceptor works for eager loading m2m edges ( #3257 )
...
* entc/gen: make interceptor works for eager loading m2m edges
* entc/gen: make interceptor works for eager loading m2m edges
* entc/gen: fix indent
* entc/gen: go generate example
2023-01-23 15:42:08 +02:00
Ariel Mashraki
ef0427550f
ent: add additional fields to QueryContext
2023-01-14 22:47:54 +02:00
Ariel Mashraki
b88f45aa78
entc/gen: skip executing sub-query for empty set of edges ( #3212 )
2023-01-07 08:54:18 +02:00
Ariel Mashraki
f1205ce95f
entc/gen: remove driver specific implementation for Exist ( #3136 )
2022-12-01 17:39:52 +02:00
Ariel Mashraki
53bdc325c0
entc/gen/schemaconfig: set alternate edge-schema names from config ( #3087 )
...
Fixed https://github.com/ent/ent/issues/3082
2022-11-12 21:42:57 +02:00
Marwan Sulaiman
713828b311
Remove unused variable and type redundancy ( #2996 )
2022-10-09 00:59:52 +03:00
Aagosh
326fe42d49
entc/gen: use FirstID instead of Count for Exist calls ( #2896 )
...
* Improve sqlexist template
* Address review comment and regenerate files
* Regenerate using go1.19
* Run go generate for examples dir
* Address review comment
* Update entc/gen/template/dialect/sql/query.tmpl
Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com >
2022-09-04 10:04:57 +03:00
Ariel Mashraki
2c63d1d70e
all: gofmt -w -r 'interface{} -> any' ( #2874 )
2022-08-19 18:23:04 +03:00
Giau. Tran Minh
89007ec983
entc/gen: fixed privacy filter for M2M edges ( #2828 )
...
* entc: fixed privacy filter for M2M
* all: codegen
2022-08-03 23:24:25 +03:00
Ariel Mashraki
b60e0f9eac
entc/gen: add support for WithNamed<E> feature-flag ( #2792 )
...
* entc/gen: struct fields and methods for NamedEdge api
* entc/gen: generate WithNamedEdge methods for named-edges
* entc/gen: implement eager-loading for named-edges
* entc/gen: simplify eager-loading template
* entc/gen: drop support for unqiue edges in named-based loading
* all: codegen
* doc/website: named-edges feature-flag
* Update doc/md/eager-load.mdx
* Update doc/md/eager-load.mdx
2022-07-24 18:41:07 +03:00
Ariel Mashraki
a2b18f24f0
entc/gen: move eager-loading to method ( #2790 )
...
This is a preparation work for 'WithNamed<E>' API
2022-07-23 23:46:02 +03:00
Ariel Mashraki
e1c5277483
ent: initial support for edge schemas ( #2560 )
2022-05-25 15:46:00 +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
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
3e6c40886d
entc/gen: support count with field selection
...
Fixed https://github.com/ent/ent/issues/2036
2021-10-17 19:03:49 +03:00
Ariel Mashraki
ac05c1357e
examples: run codegen for examples
2021-09-21 20:25:08 +03:00
Lining Guan
f42014f019
enable distinct in sqlQuery
2021-09-18 16:01:11 +08:00
Ariel Mashraki
6a7b3c8e7a
entc/gen: add feature-flag and implementation for sql/lock
...
Fixed #358
2021-07-21 11:50:06 +03:00
Ariel Mashraki
f5c284787f
dialect/sql: allow appending select columns to query
2021-06-01 11:50:16 +03:00
Ariel Mashraki
2480b5c0ef
entc/gen: wrap nillable fields with custom go-type with sql.nullscanner
2021-04-17 13:13:40 +03:00
Ciaran Liedeman
eff6552989
entc/gen: allow users to alter Query initialization using templates ( #1453 )
...
* Templating: Allow user to alter Query struct init
* Update entc/gen/template/dialect/sql/query.tmpl
Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com >
* pr feedback
* renamed template
* changed sql to *
* to tabs
* removed old template
* update bin-data
* Update entc/integration/template/ent/template/query.tmpl
Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com >
* restore newline
* update bindata
Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com >
2021-04-14 14:04:29 +03:00
Ariel Mashraki
34aabc0eb1
entc/gen/template: add goland-annotation for template data-types
2021-04-09 17:53:04 +03:00
Ariel Mashraki
f12ef91829
entc/gen: privatize table columns check
2021-03-29 14:35:38 +03:00
Ariel Mashraki
2d09c8f846
entc/gen/features/multischema: pass schema to count query ( #1390 )
...
Fixed #1385
2021-03-25 13:48:32 +02:00
Ariel Mashraki
cf8464cb28
entc/gen/template: allow disable DISTINCT in queries ( #1371 )
2021-03-22 16:36:05 +02:00
Ariel Mashraki
e92dfee33f
entc/gen: filter duplicate ids when loading m2m edges
2021-03-16 08:44:27 +02:00
Ariel Mashraki
6ab0d01ea4
entc/gen: filter duplicate ids when loading o2m/m2o edges
2021-03-16 08:44:27 +02:00
Ariel Mashraki
c0fd7c1305
entc/gen: add edge-field api for schema and codegen ( #1213 )
2021-03-07 22:51:17 +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
0d0a93b95f
entc/gen: add support for referencing fks to existing fields ( #1289 )
2021-03-01 22:57:32 +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
Ariel Mashraki
aeb1ccc571
entc/gen: move schemaconfig template to feature-flag
2021-01-24 19:57:28 +02:00
Marwan Sulaiman
8063d4ac93
entc/gen: add context.Context to to query builder ( #1195 )
...
* Add ctx to dialectQuery
* go generate
2021-01-20 11:46:08 +02:00
Ariel Mashraki
0c2c45f0c6
entc/gen/template: allow override context.Context with custom templates
2021-01-19 10:24:26 +02:00
Ariel Mashraki
0f78dfe1c0
entc/gen/template: allow mutating the sqlgraph.EdgeQuerySpec by ent extensions or user templates
2021-01-19 09:51:38 +02:00
Ariel Mashraki
d1db24d13f
entc/gen/template: allow mutating the sqlgraph.QuerySpec by ent extensions or user templates
2021-01-19 09:51:38 +02:00
Ariel Mashraki
a761561c9c
entc/gen: support field selections with eager-loading ( #1100 )
2020-12-29 09:19:53 +02:00
Ariel Mashraki
37f9c30a12
entc/gen: apply field selection on builer types ( #1094 )
2020-12-28 14:38:20 +02:00
Ariel Mashraki
c4a43bc2be
entc/gen: move fields selection to top builder ( #1093 )
2020-12-28 12:28:07 +02:00
Ariel Mashraki
da34571560
entc/gen: allow selecting specific fields ( #1075 )
2020-12-23 17:35:39 +02:00
Ariel Mashraki
fb97ca66ac
entc/gen: move eager-loading naming to Go api ( #887 )
2020-10-27 20:11:59 +02:00
Ariel Mashraki
49101d7d05
entc/gen: change eager-loading empty values ( #791 )
...
When loading relations (using edger-loading) and there are no changes,
the response should be an empty slice (and not nil). Similar to the
way we handle simple queries (e.g. All()).
Closed #790
2020-09-22 20:22:30 +03:00