Ariel Mashraki
3f1063c77e
schema/field: add support or external ValueScanner ( #3391 )
2023-03-16 22:18:54 +02:00
Ariel Mashraki
8022271f12
entc/integration: add example for composite unique index ( #3302 )
2023-02-06 11:17:33 +02:00
Ariel Mashraki
433609444c
dialect/sql/sqljson: support for order by value and length ( #3278 )
2023-01-26 12:20:31 +02:00
Pedro Henrique
604c4942a4
dialect/sql: improve support for subqueries ( #3274 )
2023-01-26 09:43:07 +02:00
Ariel Mashraki
fa1cf83fdd
dialect/sql/sqlgraph: ignore ORDER BY clauses in COUNT queries ( #3226 )
2023-01-10 14:03:29 +02:00
Ariel Mashraki
f226627d67
ent: export query interceptors ( #3157 )
2022-12-19 10:17:10 +02:00
Ariel Mashraki
122574376b
dialect/sql: add except and intersect to builder ( #3127 )
...
* dialect/sql: add except and intersect for builder
* dialect/sql: report an error in case INTERSECT/EXCEPT ALL were set in SQLite
Co-authored-by: Liooo <ryoyamada3@gmail.com >
2022-11-28 14:54:59 +02:00
cheny-alf
2840921231
dialect/sql: fix escape issue occurred in fuzzy testing ( #3115 )
...
* fix(builder):fix escape method
* fix(builder):fix escape method
Co-authored-by: chenfuqing <chenfuqing@laiye.com >
2022-11-26 13:26:14 +02:00
Ariel Mashraki
aa3d21f01a
dialect/sql/sqlgraph: changing the M2M creation semantic from Add to Connect
...
Thus, calling AddE with the same edge values, ignore and not throw an error.
For edge-schemas with extra fields, we maintain the same logic because we cannot
determine if the extra fields have different values that what exist in the database
2022-11-20 17:37:08 +02:00
Ariel Mashraki
8d40edf24b
dialect/sql: add support for LIMIT in update statement ( #3018 )
2022-10-17 10:02:53 +03:00
Ariel Mashraki
bbdfea319d
dialect/sql: support the RETURNING clause in UPDATE ( #3016 )
...
* dialect/sql: support the RETURNING clause in UPDATE
2022-10-16 17:55:01 +03:00
Andrey Elenskiy
fe4b19a355
dialect/sql: add Window function to be able to customize function clause for window statements ( #2994 )
2022-10-11 23:45:49 +03:00
Ariel Mashraki
cf137c665a
dialect/sql/sqljson: cast marshaled args as json ( #3008 )
2022-10-11 14:15:01 +03:00
Ariel Mashraki
eb4ea68356
dialect/sql/sqljson: add dialect-aware Append function
2022-09-29 08:54:44 +03:00
Ariel Mashraki
0adfb94c30
dialect/sql: support defining multiple FROM in query ( #2933 )
2022-09-16 00:10:11 +03:00
Ariel Mashraki
1773fc465e
dialect/sql: add support for statement prefix in update builder ( #2904 )
2022-09-06 17:34:53 +03:00
Ryo Yamada
015effdcc1
dialect/sql/builder: added FullJoin ( #2885 )
...
* dialect/sql/builder: added FullJoin
* fix comment casing
Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com >
Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com >
2022-08-30 07:39:35 +03:00
Ariel Mashraki
2c63d1d70e
all: gofmt -w -r 'interface{} -> any' ( #2874 )
2022-08-19 18:23:04 +03:00
Pedro Henrique
2b54aadcce
dialect/sql: escape EqualFold on Postgres ( #2860 )
...
* adds tests for equalFold predicates
* ensure EqualFold escapes the argument on Postgres
* adds tests on builder as well
2022-08-16 10:09:06 +03:00
Ariel Mashraki
94b19ac973
dialect/sql: use raw NULL value in statements rather than passing nil arguments
2022-08-14 11:10:36 +03:00
Ariel Mashraki
9f481d8716
dialect/sql: support setting ORDER BY for UPDATE statements
2022-08-05 14:42:04 +03:00
Andy Day
8beaef87ba
dialect/sql/builder: make sql.NotIn() with empty args fallback to NOT FALSE ( #2757 )
...
* dialect/sql/builder: make sql.NotIn() with empty args fallback to False()
This is basically the identical change to #2735 , but for NotIn().
This bug currently prevents anyone using NotIn() from upgrading from v0.10.x to v0.11.x
* Update go.sum
untidy
* feedback
2022-07-19 06:36:39 +03:00
Ariel Mashraki
6c8a1308ec
entc/gen: edge schema with custom ids ( #2742 )
...
Fixed https://github.com/ent/ent/issues/2740
Fixed https://github.com/ent/ent/issues/2741
2022-07-12 18:13:45 +03:00
Ryo Yamada
b00e549c88
dialect/sql: make sql.In() with empty args fallback to False() ( #2735 )
...
* dialect/sql/builder: make sql.In() with empty args fallback to False()
* fix indent
* added comment
* remove the equilvalent logic in the codegen side
* comment fix, run go generate
2022-07-12 00:15:36 +03:00
Pedro Henrique
4d1c0af20d
entc/integration: add examples for sub-queries + minor fixed for selector builder ( #2509 )
...
* dialect/sql: move FROM to inside switch
* dialect/sql: adds simple example of subquery usage
* dialect/sql: adds a more complex example with join
* Apply suggestions from code review
Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com >
* dialect/sql: fix missing type and change modify to where
Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com >
2022-05-05 22:46:13 +03:00
Carlos González
5dd5acc08d
dialect/sql: fixed a small typo in docs ( #2459 )
2022-04-07 19:54:43 +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
92ff734815
dialect/sql: add support for window functions ( #2431 )
2022-03-27 20:53:36 +03:00
Ariel Mashraki
412947d274
dialect/sql: avoid passing bool arguments on bool predicates ( #2405 )
2022-03-15 22:52:49 +02:00
Ariel Mashraki
deb63d0292
dialect/sql: support passing selectors to basic predicates
...
Closed https://github.com/ent/ent/issues/2236
2021-12-25 15:02:49 +02:00
Ariel Mashraki
1c263c7abd
dialect/sql: add support for SelectExpr ( #2220 )
2021-12-16 13:50:03 +02:00
Ariel Mashraki
b99ce66f40
dialect/sql: calling Update.Add after Update.Set should append expression ( #2168 )
2021-11-25 12:03:12 +02:00
Ariel Mashraki
a5fea077a9
dialect/sql: use identifier qualifiers for WHERE clause on upsert
...
Fixed https://github.com/ent/ent/issues/2126
2021-11-12 23:46:46 +02:00
Alexander Melentyev
147b1f59ae
all: small typo fixes ( #2095 )
2021-11-01 17:47:06 +02:00
Ariel Mashraki
a1f6de2793
dialect/sql: escape special characters in pattern matching
...
Resources:
- https://www.postgresql.org/docs/current/functions-matching.html\#FUNCTIONS-LIKE
- https://www.sqlite.org/lang_expr.html\#the_like_glob_regexp_and_match_operators
- https://dev.mysql.com/doc/refman/8.0/en/string-literals.html
Fixed https://github.com/ent/ent/issues/2059
2021-10-24 21:14:26 +03:00
Ariel Mashraki
5f31091dcd
entc/gen: support de/incrementing values on upsert
...
Fixed https://github.com/ent/ent/issues/1952 .
2021-09-17 14:25:34 +03:00
Ariel Mashraki
912415e1e1
dialect/sql: add Add method to UpdateSet
2021-09-16 23:41:29 +03:00
Ariel Mashraki
3c650e507e
dialect/sql: use raw 0 in COALESCE function on Add calls
...
The second argument for COALESCE function is not a dynamic argument (always 0).
2021-09-16 23:07:45 +03:00
Rotem Tamir
f326c7dfd0
dialect/sql: report explicit error when trying to SELECT .. FOR UPDAT… ( #1847 )
...
* dialect/sql: report explicit error when trying to SELECT .. FOR UPDATE with sqlite
* remove redundant assertion
2021-08-17 12:54:23 +03:00
Ariel Mashraki
b8532f87a6
entc/gen: support for upsert with client generated ids
...
Fixed #1826
2021-08-14 17:44:04 +03:00
Ariel Mashraki
e71ccc6b6e
dialect/sql/sqlgraph: fix bug in entql predicate evaluation ( #1827 )
2021-08-11 21:03:52 +03:00
Ariel Mashraki
09c4306378
entc/gen: add support for upsert/on-conflict feature-flag
2021-08-04 14:01:31 +03:00
Ariel Mashraki
b19ac669c7
dialect/sql: override column values on Updater.Set
...
Avoid cases like 'SET a = 1, a = 2'.
2021-08-01 09:53:26 +03:00
Ariel Mashraki
b8f8ea0f06
dialect/sql: move onconflict clause to functional options
2021-07-28 12:49:11 +03:00
Ariel Mashraki
9de519d027
dialect/sql: add expression function support
2021-07-27 11:36:56 +03:00
Andrey Elenskiy
20b616768d
dialect/sql: return selector's alias as a table name ( #1745 )
...
In case selector's from clause has *Selector instead of *SelectTable,
TableName() function (used for column checking) will panic.
Instead, return selector's alias which is useful if the query returns
a table with the same schema as some entity. Essentially, this allows
materialized views to reuse the same entity code as long as columns
are matching.
2021-07-25 22:14:32 +03:00
Khadija Sidhpuri
364ab46333
dialect/sql: append UNION before ORDER BY ( #1761 )
...
* fix: builder to append UNION before ORDER_BY
* gofmt builder_test.go
2021-07-22 23:33:34 +03:00
Ariel Mashraki
6a7b3c8e7a
entc/gen: add feature-flag and implementation for sql/lock
...
Fixed #358
2021-07-21 11:50:06 +03:00
Tony Griezmann
201c7301aa
dialect/sql/schema: support for USING method in create index builder ( #1730 )
...
* Support for USING 'method' in create index
* Add USING 'method' in create index support for MySQL
* Fix USING 'method' for MySQL to be a raw string
2021-07-19 15:21:35 +03:00
Ariel Mashraki
99a9d6cf9b
dialect/sql: introduce lock config options
2021-07-08 16:41:01 +03:00