Commit Graph

1352 Commits

Author SHA1 Message Date
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
64e0116ed7 blog: minor style changes to crud post 2021-07-29 23:45:07 +03:00
MasseElch
2ba1c6b22d doc/website/blog: Generate a fully-working Go CRUD HTTP API with Ent (#1788)
* doc/website/blog: Generate a fully-working Go CRUD HTTP API with Ent

* Update doc/website/blog/2021-09-29-generate-a-fully-working-go-crud-http-api-with-ent.md

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

* Rename 2021-09-29-generate-a-fully-working-go-crud-http-api-with-ent.md to 2021-07-29-generate-a-fully-working-go-crud-http-api-with-ent.md

* removing formatter

* final touches

Co-authored-by: Rotem Tamir <rotemtamir@gmail.com>
Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>
2021-07-29 23:24:59 +03:00
Ariel Mashraki
3307dd5323 entc/gen: add the Exec(X) methods for BulkCreate 2021-07-29 17:50:51 +03:00
MasseElch
b4ba9eb12f doc/md: adding a missing space in writing-docs documentation (#1785) 2021-07-29 17:19:38 +03:00
Ariel Mashraki
7acf2234b6 dialect/sql/sqlgraph: allow setting stmt modifiers for create-many 2021-07-29 16:33:26 +03:00
Ariel Mashraki
b9fcbff724 dialect/sql/sqlgraph: allow setting stmt modifiers for create-one 2021-07-29 16:33:26 +03:00
MasseElch
19b418d1a0 doc/md: fixing a formatting error in writing-docs documentation 2021-07-29 15:54:54 +03:00
Ariel Mashraki
60a544bb9d doc/featureflag: add doc and example to the sql/modifier flag 2021-07-29 11:34:21 +03:00
allcontributors[bot]
d1c568dac7 docs: add shomodj as a contributor for doc (#1782)
* 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>
2021-07-29 11:27:22 +03:00
Boris Shomodjvarac
5e9cc84f99 doc/getting-started: fix typos (#1779)
fixing typo
2021-07-29 11:24:48 +03:00
Ariel Mashraki
b8f8ea0f06 dialect/sql: move onconflict clause to functional options 2021-07-28 12:49:11 +03:00
Tarrence van As
09fd9957c0 entc/integration: use exec when not interested in entity return value (#1775) 2021-07-27 22:32:27 +03:00
Ruben de Vries
1586d50f94 dialect/sql: do not call inner Scan for nil values in sql.NullScanner (#1771) 2021-07-27 12:05:22 +03:00
Ariel Mashraki
9de519d027 dialect/sql: add expression function support 2021-07-27 11:36:56 +03:00
Ciaran Liedeman
bab709001c entc/gen: fix panics during initTemplates when Config.Storage is nil (#1769) 2021-07-26 21:49:07 +03:00
Ariel Mashraki
8973af9b40 schema/field: add support for setting update default funcs to numeric fields (#1770)
* schema/field:add UpdateDefault to numeric (#1718)

* schema/field:fix comment

* schema/field: change interface to self type with DefaultFunc/UpdateDefault

* schema/field: change interface to self type with DefaultFunc/UpdateDefault

* schema/field: change interface to self type with DefaultFunc/UpdateDefault

* schema/field: add support for setting update default funcs to numeric fields

Co-authored-by: godcong <jumbycc@163.com>
2021-07-26 13:17:16 +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
Ariel Mashraki
9704c4c87b examples: update version example to follow the locking blog post 2021-07-25 16:43:20 +03:00
Tarrence van As
cdfa3e35bb entc/gen: add Exec and ExecX to Create builder (#1753) 2021-07-23 15:00:47 +03:00
allcontributors[bot]
b9a6b955f8 docs: add neel229 as a contributor for code (#1765)
* 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>
2021-07-22 23:37:37 +03:00
allcontributors[bot]
2d7b298405 docs: add squarebat as a contributor for code (#1763)
* 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>
2021-07-22 23:36:23 +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
Rotem Tamir
444b5f57b9 doc/website/blog: database locking techniques with ent (#1762)
* doc/website/blog: database locking techniques with ent

* Update doc/website/blog/2021-07-22-database-locking-techniques-with-ent.md

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

* Update doc/website/blog/2021-07-22-database-locking-techniques-with-ent.md

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

* Update doc/website/blog/2021-07-22-database-locking-techniques-with-ent.md

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

* Update doc/website/blog/2021-07-22-database-locking-techniques-with-ent.md

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

* Update doc/website/blog/2021-07-22-database-locking-techniques-with-ent.md

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

* Update doc/website/blog/2021-07-22-database-locking-techniques-with-ent.md

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

* Update doc/website/blog/2021-07-22-database-locking-techniques-with-ent.md

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

Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>
2021-07-22 17:05:24 +03:00
Neel Modi
051f19a997 entc/gen: fix typo in templates (#1760)
* fix typo

* fix typo
2021-07-22 12:19:39 +03:00
Ariel Mashraki
0751c342c6 doc/feature-flags: mention the new sql/lock feature-flag 2021-07-21 11:50:06 +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
dependabot[bot]
73f849ac51 build(deps): bump actions/setup-node from 2.2.0 to 2.3.0 (#1756)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 2.2.0 to 2.3.0.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v2.2.0...v2.3.0)

---
updated-dependencies:
- dependency-name: actions/setup-node
  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>
2021-07-21 10:38:01 +03:00
Ariel Mashraki
279d6c2a12 dialect/sql/sqlgraph: add support for query modifiers 2021-07-20 13:14:39 +03:00
Tarrence van As
dfc7a79f6d schema/field: support unique bytes (#1720) 2021-07-20 10:24:38 +03:00
dependabot[bot]
756517e559 build(deps): bump aws-actions/configure-aws-credentials (#1747)
Bumps [aws-actions/configure-aws-credentials](https://github.com/aws-actions/configure-aws-credentials) from 1.5.10 to 1.5.11.
- [Release notes](https://github.com/aws-actions/configure-aws-credentials/releases)
- [Changelog](https://github.com/aws-actions/configure-aws-credentials/blob/master/CHANGELOG.md)
- [Commits](https://github.com/aws-actions/configure-aws-credentials/compare/v1.5.10...v1.5.11)

---
updated-dependencies:
- dependency-name: aws-actions/configure-aws-credentials
  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>
2021-07-20 10:23:08 +03:00
Ariel Mashraki
6ff6e81652 doc/template: add docs for template helpers 2021-07-20 09:57:28 +03:00
Ariel Mashraki
81eeefa6a2 entc/gen: add support for helper templates
Closed #1655
2021-07-20 09:57:28 +03:00
allcontributors[bot]
dd4d2521a7 docs: add nmemoto as a contributor for doc (#1744)
* 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>
2021-07-19 21:27:26 +03:00
Takafumi Umemoto
bf45b2f2b0 doc/faq: fix typo in sonyflake example (#1743) 2021-07-19 21:26:50 +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
Rotem Tamir
0f16f49fff doc/md: slight rewording of privacy.md (#1740) 2021-07-19 14:54:04 +03:00
Ariel Mashraki
96e43e8b93 doc/privacy: revert wrong format verb of error (#1739) 2021-07-19 13:56:57 +03:00
Zeev Manilovich
f9a9773c42 doc/md: improving privacy docs and multi tenant example (#1724)
* doc/md: improving privacy docs and multi tenant example

* cr changes

* removing error wrap in since it already exists in Denyf function

* Apply suggestions from code review

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

* cr fixes

* Update doc/md/privacy.md

* Update doc/md/privacy.md

* Update doc/md/privacy.md

* Update doc/md/privacy.md

* Update examples/privacytenant/example_test.go

* Update examples/privacytenant/rule/rule.go

Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>
2021-07-19 13:29:21 +03:00
Zeev Manilovich
e46b18f078 entc/load: removing unneeded var from template (#1737) 2021-07-19 12:03:03 +03:00
Ariel Mashraki
b8129817ca entc/gen: return an error instead of panic when import forgotten 2021-07-19 11:25:52 +03:00
Ariel Mashraki
6262a1cadc examples/fs: document example and add readme 2021-07-18 22:03:56 +03:00
Ariel Mashraki
34578936dd examples: fix image links 2021-07-18 20:47:31 +03:00
Ariel Mashraki
6310a5fdd7 examples/version: provide an optimistic locking example 2021-07-18 18:19:41 +03:00
Ariel Mashraki
88b168ad09 entc/gen: exposing filter/where api on mutations 2021-07-18 18:19:41 +03:00
Ariel Mashraki
92f4e83714 website: star Ent at GitHub header 2021-07-17 15:38:35 +03:00
Ariel Mashraki
430a3ee8b3 entc/gen: add example for uuid edge-field and fix #1723 (#1731) 2021-07-16 22:33:28 +03:00
Ariel Mashraki
79716e47d0 dialect/sql/schema: remove unneeded nolint rule 2021-07-16 14:07:40 +03:00
Ruben de Vries
1ea718f7bf dialect/sql/schema: add support for postgres and mysql numeric and decimal types in migrations (#1721)
* improve error message when failing to generate changeset

* support migrations for postgres and mysql numeric fields
2021-07-16 13:57:53 +03:00
dependabot[bot]
137c83a685 build(deps): bump github.com/mattn/go-sqlite3 from 1.14.7 to 1.14.8 (#1726)
Bumps [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) from 1.14.7 to 1.14.8.
- [Release notes](https://github.com/mattn/go-sqlite3/releases)
- [Commits](https://github.com/mattn/go-sqlite3/compare/v1.14.7...v1.14.8)

---
updated-dependencies:
- dependency-name: github.com/mattn/go-sqlite3
  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>
2021-07-16 10:16:44 +03:00