Commit Graph

377 Commits

Author SHA1 Message Date
Ariel Mashraki
798d58f02b all: use more go-ish error for constraint failures 2019-12-17 23:17:55 +02:00
Ariel Mashraki
c6800a3869 entc/gen: move node creation to sqlgraph 2019-12-17 22:45:04 +02:00
Ariel Mashraki
5e9d13be97 Merge pull request #251 from facebookincubator/sqlgraph/isolate
all: move sqlgraph to its own package
2019-12-17 18:37:58 +02:00
Ariel Mashraki
822f7e3efe ci: run codegen and test examples on integration 2019-12-17 18:33:32 +02:00
Ariel Mashraki
0cc74b5297 all: move sqlgraph to its own package 2019-12-17 18:26:09 +02:00
Jeremy
58b5389275 schema/edge: fix comment error on builder 2019-12-15 19:10:26 +02:00
Ariel Mashraki
351984717c Merge pull request #245 from facebookincubator/schema/pg-migrate
dialect/sql/schema: drop unique constraint on pg migration
2019-12-15 18:55:56 +02:00
Ariel Mashraki
6bb834612c dialect/sql/schema: drop unique constraint on pg migration
Fixes #235
2019-12-15 18:52:05 +02:00
Ariel Mashraki
dcb16c4ff6 Merge pull request #242 from facebookincubator/schema/pg-migrate
dialect/sql/schema: keep the original name of pg index
2019-12-15 16:50:19 +02:00
Ariel Mashraki
58486009c2 dialect/sql/schema: keep the original name of pg index 2019-12-15 16:47:46 +02:00
Ariel Mashraki
7b5b7db183 Merge pull request #241 from facebookincubator/schema/pg-migrate
dialect/sql/schema: correctly check pg unique constraint
2019-12-15 16:43:56 +02:00
Ariel Mashraki
25fe5b8f4a dialect/sql/schema: correctly check pg unique constraint 2019-12-15 16:41:28 +02:00
Ariel Mashraki
98f1a28ad6 Merge pull request #240 from facebookincubator/entc/remove-ms
entc/gen: remove multi storage support
2019-12-15 15:05:45 +02:00
Ariel Mashraki
802e3b583a entc/integration: run tests with migrate options 2019-12-15 15:03:24 +02:00
Ariel Mashraki
e85b10be36 entc/gen: remove multi storage support 2019-12-15 14:48:55 +02:00
Jeremy
d9c1076027 schema/field: enhance test cases 2019-12-14 13:08:53 +02:00
Jeremy
59ddab244d fix comment error in schema-edges.md (#238) 2019-12-13 18:14:07 +02:00
Ariel Mashraki
1311f5f2f2 Merge pull request #237 from hantmac/master
Fix comment error
2019-12-13 07:08:18 +02:00
hantmac
e045095ce2 fix comment error 2019-12-13 11:32:56 +08:00
Ariel Mashraki
6f3d7d8999 Merge pull request #234 from facebookincubator/sqlgraph/query
dialect/sql/sqlgraph: add initial work for nodes-count
2019-12-12 17:28:41 +02:00
Ariel Mashraki
fb4e1b6234 dialect/sql/sqlgraph: add tests for nodes count 2019-12-12 17:22:36 +02:00
Ariel Mashraki
26ccecdf6d dialect/sql/sqlgraph: add initial work for nodes-count 2019-12-12 17:14:34 +02:00
Ariel Mashraki
486c540ecc Merge pull request #232 from facebookincubator/sqlgraph/query
dialect/sql/sqlgraph: first work on nodes querying
2019-12-12 17:00:46 +02:00
Ariel Mashraki
4ab244cf93 dialect/sql/sqlgraph: first work on nodes querying 2019-12-12 12:56:31 +02:00
Ariel Mashraki
a23008a983 Merge pull request #231 from facebookincubator/sqlgraph/delete
dialect/sql/sqlgraph: delete nodes in the graph
2019-12-11 15:41:13 +02:00
Ariel Mashraki
9f324ce030 dialect/sql/sqlgraph: delete nodes in the graph 2019-12-11 15:39:20 +02:00
Ariel Mashraki
ddd69ec90a Merge pull request #230 from facebookincubator/sqlgraph/update
sqlgraph/update
2019-12-11 14:59:47 +02:00
Ariel Mashraki
429e331b32 dialect/sql/sqlgraph: add edge tests for nodes update 2019-12-11 14:41:27 +02:00
Jian Li
e84da15b37 fix predicates doc type error (#229) 2019-12-11 07:39:14 +02:00
Ariel Mashraki
876e454d1e dialect/sql/sqlgraph: add rest of edges to update-nodes 2019-12-10 21:22:09 +02:00
Ariel Mashraki
330061fbf1 Merge pull request #228 from facebookincubator/sqlgraph/update
dialect/sql/sqlgraph: update nodes using predicate
2019-12-10 17:29:01 +02:00
Ariel Mashraki
f86e39f179 dialect/sql/sqlgraph: update nodes using predicate
Currently, only fields and own-FK.
Next PR will edge types: M2M, O2M and O2O (non-inverse).
2019-12-10 17:17:35 +02:00
Ariel Mashraki
d2b65749e3 Merge pull request #226 from facebookincubator/doc/edge-examples
doc: fix example link in edges doc
2019-12-09 09:34:08 +02:00
Ariel Mashraki
8f3f496308 doc: fix example link in edges doc 2019-12-09 09:31:18 +02:00
Ariel Mashraki
75c70bac1b Merge pull request #225 from facebookincubator/examples/regen
examples: regenerate assets
2019-12-09 09:14:55 +02:00
Ariel Mashraki
ef7a1ed300 examples: make examples testable 2019-12-09 09:05:05 +02:00
Ariel Mashraki
754a8c9daa examples: regenerate assets 2019-12-09 08:13:34 +02:00
Ariel Mashraki
f65cf5150e dialect/sqlscan: add interface{} scanning support
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/223

Reviewed By: alexsn

Differential Revision: D18878581

fbshipit-source-id: 4a60ceea6c092f065e52e6b3bb625487451a815d
2019-12-08 21:59:53 -08:00
Ariel Mashraki
0fb33aaa5e dialect/sql/sqlgraph: add update node api
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/222

Reviewed By: alexsn

Differential Revision: D18833733

fbshipit-source-id: e833d84f4e5e5c73b1c85e7387472c9a87b7947e
2019-12-08 21:59:53 -08:00
Ariel Mashraki
bb051603ac dialect/sqlgraph: add edges in node creation (#216)
Summary:
Pull Request resolved: https://github.com/facebookincubator/ent/pull/216

WIP - ignore for now

Reviewed By: alexsn

Differential Revision: D18795361

fbshipit-source-id: d3a4ef5562be5faf0837cad6364130ec203a9d37
2019-12-04 09:44:50 -08:00
Ariel Mashraki
a5e4a9cf54 dialect/sqlscan: add ScanInt64 to be used by sqlgraph
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/213

Reviewed By: alexsn

Differential Revision: D18763694

fbshipit-source-id: 890b35fcc2a28914b276ce65477788b4ddaeebf9
2019-12-03 01:44:48 -08:00
Ariel Mashraki
a4fac2db3b dialect/sqlgraph: initial work for create-node api (#211)
Summary:
Pull Request resolved: https://github.com/facebookincubator/ent/pull/211

Move out the logic from the Go templates to Go code.

Next diff will add the edges of the node.

Reviewed By: alexsn

Differential Revision: D18762049

fbshipit-source-id: c9a93672415a26a6f4a7d466e569b8b0e8b0f9ee
2019-12-02 08:12:13 -08:00
Ariel Mashraki
0f4fc12cc5 dialect/sql: support recursive pointer types
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/210

Reviewed By: alexsn

Differential Revision: D18757642

fbshipit-source-id: 6dec318f68e2f14f1c7ffdf2dcd185be130b2f77
2019-12-01 05:54:52 -08:00
Ariel Mashraki
80dab06a57 dialect/sql: match column scan with sql tag
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/209

Reviewed By: alexsn

Differential Revision: D18757390

fbshipit-source-id: 534a8404a06487d90f1f4f10b1f93c774bac2e97
2019-12-01 03:21:38 -08:00
Ariel Mashraki
1a73b8cf55 entc/gen: change neighbors-with check to use sqlgraph
Reviewed By: alexsn

Differential Revision: D18729648

fbshipit-source-id: 23eb95bdb0c34c811621a819be6581e1e6fcb474
2019-12-01 02:07:55 -08:00
Ariel Mashraki
f98dbbc440 dialect/sql/schema: remove Go 1.13 string features
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/207

Reviewed By: xjtian

Differential Revision: D18743529

fbshipit-source-id: f6420e9ca233e0ce6f9254b4f85d1711ee4d4bfa
2019-11-28 03:16:55 -08:00
Ariel Mashraki
5610d0ade9 dialect/sqlgraph: fix neighbors check with predicates
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/206

Reviewed By: alexsn

Differential Revision: D18729641

fbshipit-source-id: a5d333132ae276691ac8c1b084bc5d2037112529
2019-11-27 23:50:00 -08:00
Ariel Mashraki
29c7b0a0d8 dialect/sql: remove Go1.13 specific features
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/205

Reviewed By: alexsn

Differential Revision: D18742422

fbshipit-source-id: 1e1996fe26787788e4c0466a58884b4fa0581353
2019-11-27 23:14:24 -08:00
Ariel Mashraki
f7ce61fc3c entc/gen: change neighbors predicate to use sqlgraph
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/204

Reviewed By: alexsn

Differential Revision: D18726911

fbshipit-source-id: 6fe850bb0c0613c3f1c94e8bbcf3f0684dded9a6
2019-11-27 11:28:26 -08:00
Ariel Mashraki
5fe9fcdc1b entc/gen: fix update ids check bug in user-defined-ids
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/203

Reviewed By: alexsn

Differential Revision: D18725824

fbshipit-source-id: 888686bb5fa87649be89ec1926cbd7a3b6cf7932
2019-11-27 06:20:44 -08:00