Commit Graph

58 Commits

Author SHA1 Message Date
Ariel Mashraki
122ee020b7 dialect/sql: add support for table options (#925) 2020-11-06 18:14:23 +02:00
Ariel Mashraki
98aeb19013 entc/internal: add snapshot restore logic (#862)
Issue #852
2020-10-19 14:51:28 +03:00
maxilozoz
d6fd283f68 dialect/sql: add support for selector in the notIn predicate (#861)
* `notIn` support Selector like `in`

* `notIn` args check
2020-10-19 14:47:17 +03:00
Ariel Mashraki
16e804a788 entql: add experimental implementation for entql 2020-10-11 14:41:03 +03:00
Alex Snast
cd0a79e821 sql/builder: expand limit / offset into query instead of args (#816) 2020-10-04 13:13:56 +03:00
Ariel Mashraki
9d3a621eb8 dialect/sql: minor comments fixes 2020-10-01 20:07:16 +03:00
maxilozoz
21c2b3b467 dialect/sql: add left/right join support for selector builder 2020-10-01 20:03:45 +03:00
Ariel Mashraki
09be472be8 dialect/sql: add option for adding and getting error from builders 2020-09-10 22:53:25 +03:00
Ariel Mashraki
d16e78e686 dialect/sql: add godoc regarding the dialect/sql package (#745) 2020-09-09 12:25:17 +03:00
Ariel Mashraki
ce48ab99b8 dialect/sql/sqljson: move json predicates to a package (#735) 2020-09-07 21:22:12 +03:00
Ariel Mashraki
e4767ed83e dialect/sql: add json-eq op for predicates (#728) 2020-09-05 20:21:13 +03:00
Ariel Mashraki
6a1829cc33 dialect/sql: add DotPath option to json option (#725) 2020-09-04 14:13:29 +03:00
Ariel Mashraki
6f960ec392 dialect/sql: add has-key for json predicates (#723) 2020-09-02 17:57:20 +03:00
Ariel Mashraki
e215ae0cd7 dialect/sql: make WriteOp chainable (#710) 2020-08-29 21:18:10 +03:00
Ariel Mashraki
48389c5e94 dialect/sql: add the basic operators to WriteOp (#700)
* dialect/sql: add the basic operators to WriteOp
2020-08-26 18:20:45 +03:00
Ariel Mashraki
578de828c7 dialect/sql: change sql predicate constructor 2020-08-26 16:42:44 +03:00
Ariel Mashraki
0d23ef86de dialect/sql: wraps the bytes.Buffer methods to make them chainable 2020-08-26 16:13:26 +03:00
Ariel Mashraki
94eee235b4 dialect/sql: add json-path for sql builders 2020-08-25 11:05:32 +03:00
Ariel Mashraki
c907c8bbbc integ: add sqlite to json tests (#686) 2020-08-23 20:51:19 +03:00
Ariel Mashraki
b18716931d dialect/sql: change boolean operators wrapping (#678)
The reason is to parentheses only when it's necessary.
2020-08-20 10:08:31 +03:00
Ariel Mashraki
fd0a7f9f02 all: facebookincubator/ent => facebook/ent (#660)
ent repository is going to be migrated to facebook organization
2020-08-18 11:05:08 +03:00
Ariel Mashraki
d9c8130d08 dialect/sql: configure contains-fold per dialect (#666) 2020-08-13 17:26:19 +03:00
Ariel Mashraki
3fa749d9e3 dialect/sql: remove go1.12 support (#457) 2020-04-30 13:21:00 +03:00
Ariel Mashraki
2208b243db dialect/sql/schema: initial work for incremental migration (#428)
This is a WIP PR and should be ignored this moment.
It's based on PR #221 created by Erik Hollensbe (He should
get his credit for his work before we land this).
2020-04-12 19:12:33 +03:00
Ariel Mashraki
b4255998bf entc/gen: change name format for edge fks (#286)
* entc/gen: change name format for edge fks

* dialect/sql/schema: add fixture support for mysql and postgres

* sql/dialect: merge fkcolumn queries to one for the 2 dialects
2020-02-03 15:41:55 +02:00
Ariel Mashraki
cb5b9f6f9e dialect/sql: add drop/add-index for older version of mysql (#315)
Add support for MySQL 5.6.35
2020-01-23 20:25:48 +02:00
Ariel Mashraki
fd8c07717c dialect/sql: add change-column for mysql (#304)
Old versions of MySQL (<8) do not support the 'RENAME' caluse
2020-01-21 05:04:01 -05:00
Ariel Mashraki
4c89190e8a dialect/sql: add alter-index for renaming psql indexes (#301) 2020-01-20 18:13:55 -05:00
Ariel Mashraki
ba189b5f33 dialect/sql: add rename-index to mysql builder (#300) 2020-01-20 12:53:04 -05:00
Christoph Hartmann
46982d2f05 dialect/sql: add predicates for composite where query (#264)
* add predicates for composite where query

Signed-off-by: Christoph Hartmann <chris@lollyrock.com>

* use existing table.Columns method

* simplify the composite operator methods
2020-01-02 18:42:26 +02:00
Ariel Mashraki
ab732c7654 dialect/sql: add drop-fk command to builder 2019-12-31 21:26:02 +02:00
Ariel Mashraki
0cc74b5297 all: move sqlgraph to its own package 2019-12-17 18:26:09 +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
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
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
d2fb1b5548 dialect/sql: override RETURNING clause on postgres
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/192

Reviewed By: dlvhdr

Differential Revision: D18685852

fbshipit-source-id: 90ddd1057a7d6cfa00470a7b11fb237862edcc2b
2019-11-25 07:29:52 -08:00
Ariel Mashraki
6ce4cb6803 all: fix minor lint errors
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/159

Reviewed By: dlvhdr

Differential Revision: D18476131

fbshipit-source-id: 9e792f5a35f25233aad73f75f12d13d215a21ad2
2019-11-13 06:01:41 -08:00
Ariel Mashraki
53cfcb6e8b dialect/sql: fix predicate builder on join
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/143

Reviewed By: idoshveki

Differential Revision: D18346652

fbshipit-source-id: e8c5d7eb3cefc16f52090de0d121e82cae058fc2
2019-11-06 05:21:26 -08:00
Ariel Mashraki
c259aee24b entc/gen: generate sql builders with dialect option
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/130

Reviewed By: alexsn

Differential Revision: D18164397

fbshipit-source-id: 2858d69d3ff85c06b51382c01c3d4369ee2c3bdb
2019-10-27 21:53:50 -07:00
Ariel Mashraki
c414cd9a82 dialect/sql/schema: alter column for postgres
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/117

Reviewed By: alexsn

Differential Revision: D18083914

fbshipit-source-id: a5f6993cfe9a260a84c0d4ab868e3e797b3a5776
2019-10-23 05:39:17 -07:00
Ariel Mashraki
8be31d18f9 dialect/sql/schema: add postgres table and column builders
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/114

Reviewed By: alexsn

Differential Revision: D18059082

fbshipit-source-id: fffec25143fa5f2a0ed2c79787abacefad724862
2019-10-22 08:17:05 -07:00
Ariel Mashraki
a6df15101f dialect/sql: fix bad query generation on clone
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/97

Reviewed By: alexsn

Differential Revision: D17931134

fbshipit-source-id: e181e253f6e29b757f5ca647195d87d7ac89a0c8
2019-10-15 13:38:39 -07:00
Ariel Mashraki
6f5f42ab3c dialect/sql: dialect based builders (#1550)
Summary:
Pull Request resolved: https://github.com/facebookexternal/fbc/pull/1550

Pull Request resolved: https://github.com/facebookincubator/ent/pull/84

This is still WIP and you should ignore this.

Reviewed By: alexsn

Differential Revision: D17854477

fbshipit-source-id: 2d19713c118adb31164b7a2781327e64c87db8d4
2019-10-13 07:03:11 -07:00
Ariel Mashraki
c3955a08f1 schema/field: json type support (#38)
Summary:
Pull Request resolved: https://github.com/facebookincubator/ent/pull/38

Only `IsNil` and `NotNil` predicates are supported this moment

Reviewed By: alexsn

Differential Revision: D17444976

fbshipit-source-id: 37336fa0bc7749af995933baee2e23bb7366dd78
2019-09-19 05:00:11 -07:00
Ariel Mashraki
b067d5d8b4 dialect/sql: increment and decrement columns using "add"
Summary:
Use case:

```
query, args := Update("data_packs").
  Add("bytes_left", count).
  Where(expr...).
  Query()
```

Reviewed By: alexsn

Differential Revision: D17257590

fbshipit-source-id: f27b4b388a711a16deb0c3b790e24957e044204d
2019-09-09 05:50:59 -07:00
Ariel Mashraki
9ab0a28ffe entc/select: add selection api
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/27

Reviewed By: alexsn

Differential Revision: D17164536

fbshipit-source-id: f5caa80b05aff1ef8ec30d7a53256b00380d018c
2019-09-04 07:14:24 -07:00
Alex Snast
373769dfaf ent/gen: adding EqualFold predicate for string fields
Summary: Similar to `ContainsFold` predicate requires `--storage=sql` argument to be passed to entc.

Reviewed By: a8m

Differential Revision: D17074805

fbshipit-source-id: ced299154417fe2c9007cd6a7a504f53c8b2ef98
2019-08-27 10:48:53 -07:00
Ariel Mashraki
bd07c86b60 all: add license header to all go files
Summary:
Used addlicense to generate this:
 addlicense -c "Facebook Inc" -f license_header .

example was taken from: https://github.com/facebook/litho/blob/master/lib/soloader/BUCK

Reviewed By: alexsn

Differential Revision: D17070152

fbshipit-source-id: e7b91398d7f6181727be3400c1872ad5f28e38ed
2019-08-27 04:48:28 -07:00
Ariel Mashraki
fb56e0c786 ent/dialect/sql: add ContainsFold to builder
Reviewed By: alexsn

Differential Revision: D16961184

fbshipit-source-id: f3f0c2bdd4950340ddebca929b8fed79256c7aeb
2019-08-22 04:38:15 -07:00
Ariel Mashraki
e2524ff0ad ent/dialect/sql: add upper and lower methods
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/18

Reviewed By: elys1um

Differential Revision: D16916563

fbshipit-source-id: f758536103356cb5b2bacf707c7c7da931bb4560
2019-08-20 07:52:59 -07:00