Commit Graph

1726 Commits

Author SHA1 Message Date
MasseElch
4db0c544c2 dialect/sql: add New method to pass in a river without opening a *sql.DB before (#2504) 2022-04-28 13:12:34 +02:00
MasseElch
4e434b2b73 gen/template: allow overriding of client struct and initialization (#2503) 2022-04-28 09:07:44 +02:00
Ariel Mashraki
879bb8a905 entc/integration/json: add example for using interfaces in JSON fields (#2497) 2022-04-25 13:34:05 +03:00
Ariel Mashraki
04e0dc936b entc/integration/migrate: add example for renaming columns (#2496) 2022-04-24 22:36:33 +03:00
dependabot[bot]
7d153c7683 build(deps): bump github.com/mitchellh/mapstructure from 1.4.3 to 1.5.0 (#2488)
Bumps [github.com/mitchellh/mapstructure](https://github.com/mitchellh/mapstructure) from 1.4.3 to 1.5.0.
- [Release notes](https://github.com/mitchellh/mapstructure/releases)
- [Changelog](https://github.com/mitchellh/mapstructure/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mitchellh/mapstructure/compare/v1.4.3...v1.5.0)

---
updated-dependencies:
- dependency-name: github.com/mitchellh/mapstructure
  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-04-21 10:22:42 +03: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
Thomas Meitz
4e1affecbc doc/md - added usage note for golang-migrate (#2482)
* docs - added note for golang-migrate

* remove .vscode directory

* changed as proposed
2022-04-20 08:39:52 +02:00
MasseElch
f7a7da675f doc/md: document atlas sum file usage (#2471)
* doc/md: document atlas sum file usage

* doc/md: apply CR

* doc/md: elaborate and images
2022-04-19 08:58:07 +02:00
allcontributors[bot]
6ce239cd39 docs: add thmeitz as a contributor for code, doc (#2483) 2022-04-18 21:39:41 +03:00
Amit Shani
72e454e5fc doc/md: versioned migration typo fix (#2481) 2022-04-18 16:11:13 +03:00
Amit Shani
f1ea8def89 doc/md: fix typo (#2480) 2022-04-18 15:52:14 +03:00
dependabot[bot]
bac215a72a build(deps): bump actions/setup-go from 2 to 3 (#2465)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2 to 3.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-14 20:10:00 +03:00
Ariel Mashraki
4cf6dd75ec entc/gen: expose config on generated filters (#2473) 2022-04-14 20:00:52 +03:00
MasseElch
c1175719a2 dialect/sql/schema: option to enable atlas sum file (#2470)
* dialect/sql/schema: option to enable atlas checksum file

* entc/integration/migrate: add integration tests for versioned migrations

* entc/integration/migrate: apply CR
2022-04-13 21:36:57 +02:00
MasseElch
89dc83887c doc/md: document usage of atlas supported migration tools (#2467)
* doc/md: document usage of atlas supported migration tools

* dialect/sql/schema: fix tests
2022-04-13 12:47:00 +02:00
dependabot[bot]
cb6e0e063d build(deps): bump github.com/lib/pq from 1.10.4 to 1.10.5 (#2461)
Bumps [github.com/lib/pq](https://github.com/lib/pq) from 1.10.4 to 1.10.5.
- [Release notes](https://github.com/lib/pq/releases)
- [Commits](https://github.com/lib/pq/compare/v1.10.4...v1.10.5)

---
updated-dependencies:
- dependency-name: github.com/lib/pq
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-10 11:11:38 +03:00
dorlib
3683de1d36 doc/md: simplify graphql mutation usage (#2464) 2022-04-09 20:59:55 +03:00
Ariel Mashraki
6e4e4da896 entc/integration/migrate: update atlas and test custom time precision (#2462) 2022-04-08 11:27:30 +03:00
Carlos González
5dd5acc08d dialect/sql: fixed a small typo in docs (#2459) 2022-04-07 19:54:43 +03:00
Amit Shani
5ee0a475e4 website/blog: enthistory fix typo (#2458)
* doc/blog: enthistory fix

* fix typo
2022-04-07 17:38:27 +03:00
Amit Shani
cf0b8560bc doc/blog: enthistory fix (#2457) 2022-04-07 17:23:46 +03:00
Amit Shani
dec2216cb9 website/blog: enthistory blog post (#2456)
* doc/blog: enthistory blog post

* Apply suggestions from code review

Co-authored-by: MasseElch <12862103+masseelch@users.noreply.github.com>

* add maria example and longer SQL

* code style

* row -> field

* show off enthistory first

* minor

* CR

* closing content on tech explain

* assets

* title

* Update doc/website/blog/2022-04-07-how-twitter-can-implement.md

Co-authored-by: Hila Kashai <73284641+hilakashai@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Hila Kashai <73284641+hilakashai@users.noreply.github.com>

* Update doc/website/blog/2022-04-07-how-twitter-can-implement.md

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

* Update doc/website/blog/2022-04-07-how-twitter-can-implement.md

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

* Update doc/website/blog/2022-04-07-how-twitter-can-implement.md

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

* Apply suggestions from code review

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

* CR

* Update doc/website/blog/2022-04-07-how-twitter-can-implement.md

Co-authored-by: Hila Kashai <73284641+hilakashai@users.noreply.github.com>

* share image

Co-authored-by: MasseElch <12862103+masseelch@users.noreply.github.com>
Co-authored-by: Hila Kashai <73284641+hilakashai@users.noreply.github.com>
Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>
2022-04-07 17:19:52 +03:00
Ariel Mashraki
d92984f744 doc/website: add sql/execquery feature-flag to document (#2453) 2022-04-06 14:10:33 +03:00
Ariel Mashraki
89c339209e entc/gen: add the sql/execquery feature flag (#2447) 2022-04-06 13:34:22 +03:00
allcontributors[bot]
4f17a84dfa docs: add CharlesGe129 as a contributor for code (#2451)
* docs: update doc/md/contributors.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2022-04-06 09:47:34 +02:00
Charles Ge
e463cbca55 init db version before executing diff (#2440)
What's the problem: Under versioned migration on MySQL 8.0, unique string field would be generated as type varchar(191) instead of varchar(255). This is because in generating migration files by NamedDiff(), sqlDialect's init() method is not called. 

Further concern: For init() function, MySQL and Postgres's implementation checks the database version which is what I want. But SQLite's implementation checks the foreign_keys support. So I think there might be a better may to check the database version before doing Diff().
2022-04-06 09:43:13 +02: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
Frédéric G. MARAND
110d0d138a ent/schema/field: fix incorrect Go code in GoType() doc comments (#2441)
All examples used repeated argument names, which do not compile
2022-04-01 19:35:23 +03:00
Clarence
21ea376817 update example import (#2432) 2022-03-31 12:55:54 +02: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
317594ec80 dialect/sql/schema: prefix sqlite unique indexes with table name (#2433)
Fixed https://github.com/ent/ent/issues/2421
2022-03-28 12:54:39 +03:00
Ariel Mashraki
92ff734815 dialect/sql: add support for window functions (#2431) 2022-03-27 20:53:36 +03:00
Ariel Mashraki
cb7e0c1f1b doc/tutorial: add title with file names to code blocks (#2430) 2022-03-26 18:49:04 +03:00
allcontributors[bot]
a89d1ec40f docs: add iwata as a contributor for doc (#2427)
* docs: update doc/md/contributors.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2022-03-25 16:17:06 +01:00
Motonori Iwata
e1e47e61f3 Write a document for custom formatter of migrate (#2415)
* Write a document for custom formatter of migrate

closes https://github.com/ent/ent/issues/2408

* Update doc/md/versioned-migrations.md

Co-authored-by: MasseElch <12862103+masseelch@users.noreply.github.com>

* Update doc/md/versioned-migrations.md

Co-authored-by: MasseElch <12862103+masseelch@users.noreply.github.com>

* more helpful code snippet

* Update doc/md/versioned-migrations.md

Co-authored-by: MasseElch <12862103+masseelch@users.noreply.github.com>

* Update doc/md/versioned-migrations.md

Co-authored-by: MasseElch <12862103+masseelch@users.noreply.github.com>

* Update doc/md/versioned-migrations.md

Co-authored-by: MasseElch <12862103+masseelch@users.noreply.github.com>

Co-authored-by: MasseElch <12862103+masseelch@users.noreply.github.com>
2022-03-25 16:13:22 +01:00
Ariel Mashraki
6c30ca7d4f dialect/sql/schema: skip creating unique key for primary keys (#2425) 2022-03-24 18:53:36 +02:00
Ariel Mashraki
c00b4ecb0f entc/integration/custom_id: update atlas and fix issue in integration tests (#2424) 2022-03-24 17:55:55 +02:00
Amit Shani
71020f8d7b doc/website/blog: tidb indentation fix (#2423) 2022-03-24 15:07:38 +02:00
Ariel Mashraki
55ed0508c7 doc: minor impronments to getting-started (#2422) 2022-03-24 12:42:57 +02:00
dependabot[bot]
e20e658cdd build(deps): bump actions/cache from 2.1.7 to 3 (#2420)
Bumps [actions/cache](https://github.com/actions/cache) from 2.1.7 to 3.
- [Release notes](https://github.com/actions/cache/releases)
- [Commits](https://github.com/actions/cache/compare/v2.1.7...v3)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-24 10:45:38 +02: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
Frédéric G. MARAND
938233b191 doc: update installation in getting-started (#2414)
since Go 1.18 `go get` is no longer the way to download a command for any supported version: updated to use go install instead.
2022-03-20 11:47:06 +02:00
Frédéric G. MARAND
0d9173c0b9 doc: update schema-def to use proper method (#2416)
The exemple incorrectly adds an ignored `User.Index` method, although ent actually needs a `User.Indexes` method as part of `ent.Interface`
2022-03-20 11:46:06 +02:00
Ariel Mashraki
a7c1df2d0a entc/gen: move selectbuilder scan functions to shared struct (#2412) 2022-03-18 07:59:04 +02:00
MasseElch
286eec4b38 all: drop 1.16 support and run CI on 1.17 and 1.18 (#2411) 2022-03-17 17:30:13 +01:00
Rotem Tamir
865ddb8d47 doc/website/blog: small fixes 2022-03-17 14:54:57 +02:00
Amit Shani
683fe8cc3b doc/website/blog: TiDB announcement (#2396) 2022-03-17 14:42:15 +02:00
Zeev Manilovich
b1abbd3d65 dialect/sql/schema: without foreign keys option for atlas (#2404)
* dialect/sql: without foreign key option for atlas

* handle fks in modifytables

* add tests

* tests

* Update dialect/sql/schema/atlas.go

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

* ct and tests

Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>
2022-03-16 17:27:23 +02:00