Commit Graph

1822 Commits

Author SHA1 Message Date
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
42b68cb9fc doc/website: use title in code blocks (#2769) 2022-07-17 19:07:02 +03:00
Ariel Mashraki
9a04641525 go: update ariga.io/atlas to latest master (#2767) 2022-07-17 17:27:12 +03:00
Ariel Mashraki
077670451a entc/gen: skip enum identifier checks in case it has custom Go type (#2766)
Fixes https://github.com/ent/ent/issues/2756
2022-07-17 17:14:43 +03:00
Sasha Melentyev
9e0d8af284 ent/gen: use error.New for errors without format (#2764) 2022-07-17 16:50:50 +03:00
Ariel Mashraki
ddc46d34d8 schema/field: correctly extract package names from type identifier (#2765)
Fixes https://github.com/ent/ent/issues/2761
2022-07-17 16:49:11 +03:00
Ariel Mashraki
01f97334af entc/gen: use custom schema-type in join tables foreign-keys (#2760)
Fixed https://github.com/ent/ent/issues/2753
2022-07-15 11:01:13 +03:00
Ariel Mashraki
047b804dcd ent/gen: remove unnecessary if block in IN predicates (#2758) 2022-07-15 10:30:23 +03:00
Ariel Mashraki
1c6ba55f9c go: update ariga.io/atlas (#2754) 2022-07-14 17:10:34 +03:00
Ariel Mashraki
5df06f49c1 go: update ariga.io/atlas (#2752) v0.11.1 2022-07-14 10:29:04 +03:00
Ariel Mashraki
e601697fa8 go: update ariga.io/atlas (#2751) 2022-07-13 21:39:38 +03:00
Amr Tamimi
4491610202 entc/gen/integration: add example for edge schema with privacy (#2743) 2022-07-13 19:25:09 +03:00
Ariel Mashraki
b5b5d87f08 entc/gen/integration: re-enable postgres tests (#2749) 2022-07-13 18:30:57 +03:00
Ariel Mashraki
1c01301de1 sql/dialect/schema: support setting PK to serial types in postgres (#2748) v0.11.0 2022-07-13 14:40:56 +03:00
nine-hundred
dd4a0203e5 When run 'go generate ./ent', got error on [create type Todo: invalid default value for enum field "status"] (#2746)
Because todo.graphql on tutorial-todo-gql.md says enum Status is "IN_PROGRESS"
2022-07-13 14:03:32 +03:00
Ariel Mashraki
3148324cbe entc/gen: support edgeschema with privacy (#2745) 2022-07-13 11:54:40 +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
Jannik Clausen
bc623b3f64 all: update atlas (#2739) 2022-07-11 15:25:14 +02:00
Jannik Clausen
0f33b0bcb8 doc/md: update docs to fix #2731 (#2732) 2022-07-08 20:26:46 +02:00
Jannik Clausen
52a109128d doc/md: type safe feature activation versioned migration (#2727)
* type safe feature activation in example

* Update doc/md/versioned-migrations.md

Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>
2022-07-07 15:21:44 +03:00
Ariel Mashraki
ba582c83b3 entc/gen: improve edge-schema updates (#2726)
Also, added additional example where an edge schema has another edge
to a type that holds an information about the relationship.

The only reason this example exists is to allow users to reduce the storage
occupied by the join-table and allow connect (via M2O) multiple edge-schemas
to an 'information'/'description' node.
2022-07-07 07:34:17 +03:00
Jannik Clausen
412f5f75ca add docs about auto-increment counter "bug" in MySQL versions < 8.0 and how to handle it (#2722) 2022-07-06 10:34:39 +02:00
dependabot[bot]
97a13dfa9b build(deps): bump github.com/spf13/cobra from 1.4.0 to 1.5.0 (#2724)
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.4.0 to 1.5.0.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v1.4.0...v1.5.0)

---
updated-dependencies:
- dependency-name: github.com/spf13/cobra
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-06 10:31:44 +03:00
Ariel Mashraki
2c1a3555cc entc/gen: ignore edge-fields order in edge-schema with composite identifiers (#2719)
This PR allows defining edge schemas with any order of their edges
but still enforce the ordering of the fields in the ID annotation
2022-07-05 15:45:28 +03:00
Ariel Mashraki
8c55008a9d dialect/sql/sqlgraph: handle edge schema in batch inserts (#2718) 2022-07-05 14:15:31 +03:00
Jannik Clausen
5b67bdab4f dialect/sql/schema: atlas engine is now default (#2698)
* atlas engine is default, enabled diff by replay

* Apply suggestions from code review

* docs

* apply CR
2022-07-05 12:29:15 +02:00
Reiji Tokuda
91b643091f entc/gen: support setting GoType for integer IDs (#2657)
* Fix problem when model maps integer id to a GoType

* Update generated files

* apply suggestions from code review

* Update generated files

* Update generated files after merge from master

* Cleanup test code in integration

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

* Modify integration test IntSID.

Wrapped tests of IntSID for avoid conflicts.

* Modify tests in integrations

Order of tests was changed. As a result, if-statement for difference in RDB is deleted.

+ force pushing same commit to invoke ci.

Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>
2022-07-04 08:50:51 +03:00
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
aec59a3aa7 doc/md: update eager-loading implementation details (#2707) 2022-07-01 21:52:35 +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
8416fb502d dialect/sql/schema: setup tables before running migrate diff (#2703)
Keep the same API as schema.Create
2022-06-30 09:55:40 +03:00
Ariel Mashraki
6793d74da7 schema/field: support for sensitive json fields (#2701)
Closed https://github.com/ent/ent/issues/2596
2022-06-29 11:27:10 +03:00
Hafiz Shafruddin
5dbfa24b46 doc/md: add docs on using expression predicates in custom WHERE clauses (#2520)
* Add docs on using ExprP() for custom WHERE sql statement

* Add ExprP() examples using integration test

* move custom predicate example and show examples using both P() and ExprP()

* fix to greater or equal than

* rephrase wording and fix sql builder

* Update doc/md/predicates.md

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

* Update doc/md/predicates.md

* Update doc/md/predicates.md

* Update doc/md/predicates.md

* Update doc/md/predicates.md

Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>
2022-06-29 11:24:20 +03:00
frederikhors
84b05c05cd doc/md: add info about using WhereInput as predicates (#2691)
* Add info about using `WhereInput` in with `.Where()`

* Update doc/md/predicates.md

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

* Update tutorial-todo-gql-filter-input.md

* Update predicates.md

* Update predicates.md

* Update tutorial-todo-gql-filter-input.md

Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>
2022-06-27 14:57:11 +03:00
Nikita
e8bf1d1cbd doc/md: fix up examples in getting-started (#2690) 2022-06-26 15:00:58 +03:00
Ariel Mashraki
7cac3b2ed5 entc/gen: support default id values for edge schemas (#2688) 2022-06-25 20:23:43 +03:00
ben
49fc14f12f examples/start: update group schema (#2687)
There's an echo in here?!  ;-)
2022-06-25 14:59:26 +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
b44d593861 doc/website: oss footer logo (#2678) 2022-06-23 15:30:06 +03:00
Ariel Mashraki
3bb5292c83 ci: remove unnecessary build flag from go test (#2672) 2022-06-22 18:20:53 +03:00
dependabot[bot]
65ae273dee build(deps): bump github.com/spf13/cobra from 1.4.0 to 1.5.0 (#2667)
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.4.0 to 1.5.0.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v1.4.0...v1.5.0)

---
updated-dependencies:
- dependency-name: github.com/spf13/cobra
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-22 18:20:30 +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
smizuno2018
b89b13bbdb doc/tutorial: fix typos (#2663) 2022-06-19 09:59:04 +03:00
Ariel Mashraki
98d00a35b5 go: update atlas and test global-unique-id migration (#2661) 2022-06-18 21:50:44 +03:00
Jannik Clausen
7017cbc898 dialect/sql/schema: file based type store (#2644)
* dialect/sql/schema: file based type store

This PR adds support for a file based type storage when using versioned migrations. The file called `.ent_types` is written to the migration directory alongside the migration files and will be kept in sync for every migration file generation run.

In order to not break existing code, where the type storage might differ for different deployment, global unique ID mut be enabled by using a new option. This will also be raised as an error to the user when attempting to use versioned migrations and global unique ID.

Documentation will be added to this PR once feedback on the code is gathered.

* apply CR

* fix tests

* change format of types file to exclude it from atlas.sum file

* docs and drift test

* apply CR
2022-06-15 16:10:15 +02: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