Commit Graph

285 Commits

Author SHA1 Message Date
Ariel Mashraki
ae0cdf0445 dialect/sql: minor test changes (#1247) 2021-02-07 19:08:22 +02:00
Ruben de Vries
9e610c7b54 dialect/sql: fix Builder.Join implementation for postgres (#1212)
Don't use .Total() in builder.Join and purely rely on len(args).
2021-02-07 18:07:48 +02:00
Ariel Mashraki
dd4792f5b3 go: rename module from github.com/facebook/ent => entgo.io/ent (#1226) 2021-02-02 23:03:04 +02:00
Ariel Mashraki
95d780e55e dialect/sql/schema: add mysql text for column scan (#1219) 2021-01-31 22:25:38 +02:00
Ariel Mashraki
3930d3c835 schema/field: implement field.Other (#1218)
* Implement Other Field

* Implement Other Field

* Changed dialect types

* run generate

* doc typo

* docs added

* schema/field: additional validation and tests for Other type

Co-authored-by: Ciaran Liedeman <ciaran@stackworx.io>
2021-01-31 17:43:28 +02:00
Ariel Mashraki
2c7228c23f dialect/sql/sqlgraph: add schema for deletion command 2021-01-24 19:57:28 +02:00
Ariel Mashraki
aeb1ccc571 entc/gen: move schemaconfig template to feature-flag 2021-01-24 19:57:28 +02:00
Ariel Mashraki
f315801779 dialect/sql/sqlgraph: apply predicate on update-node 2021-01-22 23:04:09 +02:00
Marwan Sulaiman
3439ca207f dialect/sql/sqlgraph: pass context.Context to *sql.Selector (#1186)
* Ensure sqlgraph passes the context to *sql.Selector

* Update dialect/sql/sqlgraph/graph_test.go

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

* Update dialect/sql/sqlgraph/graph_test.go

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

* gofmt

Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>
2021-01-18 19:41:59 +02:00
Marwan Sulaiman
ddb25280cd dialect/sql: Add context.Context to sql.Selector (#1185) 2021-01-18 17:32:42 +02:00
Ariel Mashraki
0ac3526d30 dialect/sql/schema: test postgres inspection 2021-01-18 12:38:39 +02:00
Ariel Mashraki
cc8da8fbf7 dialect/sql/schema: schema match from predicate 2021-01-18 12:38:39 +02:00
Ariel Mashraki
7e904f0e1c dialect/sql/schema: add sqlite test for inspector (#1183) 2021-01-18 11:21:39 +02:00
Ariel Mashraki
8b798d2714 dialect/sql/schema: add tables inspection capabilities (#1178) 2021-01-17 16:41:07 +02:00
Ariel Mashraki
a692086309 dialect: support for begintx in debug mode (#1176) 2021-01-15 15:13:50 +02:00
Ariel Mashraki
91f7e3363a dialect/sql/schema: support providing alternate schema for postgres (#1172) 2021-01-14 16:55:37 +02:00
Ariel Mashraki
601a4ee50d dialect/sql/schema: support alternate schema for drivers (#1167) 2021-01-13 14:21:03 +02:00
Ariel Mashraki
d4d10d3977 dialect/sql: support sql expression in predicate args (#1166) 2021-01-13 14:12:01 +02:00
Marwan Sulaiman
13b61ff455 dialect/sql/sqlgraph: schema options for operations (#1136)
* Add schema options for sql graph

* PR Fixes
2021-01-12 09:29:01 +02:00
Ariel Mashraki
5fc907451f dialect/sql: test order by expression 2021-01-11 17:22:20 +02:00
Ariel Mashraki
ad92b2323b dialect/sql: add option to order by expression 2021-01-11 17:22:20 +02:00
Ariel Mashraki
3f75ffabd8 dialect/sql: add expr querier 2021-01-11 17:22:20 +02:00
Ariel Mashraki
f2aa1854e4 schema/field: generate numeric builder with new godoc 2021-01-10 14:28:12 +02:00
Ariel Mashraki
727e41e357 dialect/sql/sqlscan: skip unexported struct fields 2021-01-09 18:58:31 +02:00
Ariel Mashraki
9dd3933919 dialect/sql/sqlscan: test invalid inputs 2021-01-09 17:27:34 +02:00
Ariel Mashraki
9c9f85d7ff dialect/sql: add checks for scanning validity 2021-01-09 17:27:34 +02:00
Ariel Mashraki
cfb8f5c4a9 dialect/sql/schema: minor style changes (#1152) 2021-01-07 20:37:47 +02:00
Ruben de Vries
a9c39bb952 dialect/sql/schema: add migration hooks (#1150) 2021-01-07 20:23:01 +02:00
Ariel Mashraki
2aad872da5 dialect/sql/schema: combine binary and varbinary to one clause (#1140) 2021-01-06 15:28:26 +02:00
Noah-Jerome Lotzer
d384b3ecc4 dialect/sql/schema: add mysql binary support for native uuid handling in 8.0+ (#1085) 2021-01-06 14:47:41 +02:00
Marwan Sulaiman
5118e82422 dialect/sql: skip schema prefix when dialect is SQLite (#1135)
* Skip schema prefix when dialect is SQLite

* Update dialect/sql/builder.go

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

* abstract schema checks

Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>
2021-01-05 22:10:36 +02:00
Marwan Sulaiman
cc4c3afe92 Add schema options for sql builders (#1134) 2021-01-05 19:42:53 +02:00
Ciaran Liedeman
4a1ac1eef1 dialect/sql/sqlgraph: allow arbitrary last insert id type (#1104) 2020-12-31 12:54:44 +02:00
Santi Aguilera
75d93200e9 dialect/sql/entsql: allow non incremental primary keys (#1074)
* Allow non incremental PKs

* Format code with gofmt

* Update entc/integration/config/config_test.go

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

* Update entc/integration/config/config_test.go

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

* Update entc/integration/config/config_test.go

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

* Update entc/integration/config/config_test.go

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

* Sort imports

Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>
2020-12-28 17:34:27 +02:00
Ariel Mashraki
0f7ab71e24 dialect/sql: reset predicate before execute (#1092) 2020-12-28 11:45:16 +02:00
Ariel Mashraki
93e6a6cebd dialect/sql/schema: minor style changes (#1088) 2020-12-27 20:12:55 +02:00
Ciaran Liedeman
7320b0d16c dialect/sql/schema: add pg user defined type for schema introspect (#994)
* Added user defined fields

* pr feedback

* added integration test

* run generate

* Update dialect/sql/schema/postgres_test.go

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

* Update dialect/sql/schema/postgres_test.go

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

* Update dialect/sql/schema/postgres_test.go

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

* Update dialect/sql/schema/postgres_test.go

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

* Update dialect/sql/schema/postgres_test.go

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

* Update dialect/sql/schema/postgres_test.go

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

* Update dialect/sql/schema/postgres_test.go

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

* Update dialect/sql/schema/postgres_test.go

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

* Update dialect/sql/schema/postgres_test.go

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

* Update dialect/sql/schema/postgres_test.go

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

* Update dialect/sql/schema/postgres_test.go

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

* Update dialect/sql/schema/postgres_test.go

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

* Update dialect/sql/schema/postgres_test.go

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

* Update dialect/sql/schema/postgres_test.go

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

* Update dialect/sql/schema/postgres_test.go

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

* Update dialect/sql/schema/postgres_test.go

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

Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>
2020-12-27 20:00:47 +02:00
Ariel Mashraki
da34571560 entc/gen: allow selecting specific fields (#1075) 2020-12-23 17:35:39 +02:00
Ariel Mashraki
7e3d5fdfb5 dialect/sql/schema: add support for json migration in older versions of mariadb (#1066) 2020-12-20 11:11:22 +02:00
Ariel Mashraki
eca18b0894 dialect/sql: add check clause for column builder (#1065) 2020-12-20 10:33:34 +02:00
Nathaniel Peiffer
754e89c6ae entc/gen: add support for indexing id fields (#991)
* fix: allow indexes to be created on ID field

* test: add case for id field

* remove extraneous nil check

* change add primary method

* add integration test for mixin id

* go generate

* add default for default

* make linter happy

* invert if statement

* add default index to card integration test

* add index on default id, mixin id, and composite index

* go generate
2020-12-17 17:58:01 +02:00
Ariel Mashraki
70fbcb24e5 Revert "dialect: add alwaysfail driver (#1053)"
This reverts commit b3e118d301.
2020-12-17 15:59:49 +02:00
Ariel Mashraki
b3e118d301 dialect: add alwaysfail driver (#1053) 2020-12-17 15:56:25 +02:00
Ariel Mashraki
43fa0ae9bc dialect/sql/sqlgraph: skip empty updates (#1043) 2020-12-14 10:16:21 +02:00
Ariel Mashraki
be9955a860 entc/load: merge annotations from the same type 2020-12-13 19:16:54 +02:00
Ariel Mashraki
ad01a0aadb dialect/entsql: implement merge for annotations 2020-12-13 19:16:54 +02:00
Ariel Mashraki
86b9d850ee dialect/sql/mysql: remove enum sorting (#1021)
* dialect/sql/mysql: remove enum sorting 

Enums are not longer created as sorted values

* Update mysql_test.go
2020-12-07 14:07:13 +02:00
Ariel Mashraki
ed4a8fe010 dialect/sql/schema: replace all unquote for postgres dialect (#1019) 2020-12-06 11:49:02 +02:00
Ariel Mashraki
47c0ade6c7 dialect/sql/schema: replace all unquote for mysql dialect (#1017) 2020-12-05 22:49:01 +02:00
Ariel Mashraki
b70ba95d7b dialect/sql/schema: replace table unquote with schema option (#1016) 2020-12-05 19:43:17 +02:00