* dialect/sql/schema: fix no change condition in atlas
* dialect/sql/schema: fix bug in atlas integration when working WithDropIndex/WithDropColumn
Co-authored-by: Zeev Manilovich <zeevmanilovich@gmail.com>
* dialect/sql/schema: fix go doc
* all: update atlas
* dialect/sql/schema: diff connected DB and defined schema and write changes to migration file
* dialect/sql/schema: use migration directory and formatter directly instead of a planner
* all: update atlas
* cmd: add command to create a new migration file
* entc/gen: generate main.go with migrate diff example
* all: regenerate
* cmd/internal/base: make linter happy
* all: support Go 1.16 in versioned migrations main.go
* entc/gen: put versioned migrations behind feature flag
* all: regenerate
* cmd/ent: driver-prefixed dsn in migrate diff command
* cmd/internal/base: remove prefix from migrate import
* cmd/internal/base: use cobra.CheckErr
* cmd: remove diff command
* entc/gen/template/dialect/sql/feature: remove generated main.go
* all: rebase on master and go mod tidy
* all: regenerate
For example, in PostgreSQL, every statement is executed within a transaction. Therefore, we can avoid creating transaction
blocks manually (group of statements surrounded by BEGIN and COMMIT) for CreateNode operation with single SQL statement.
Benchmark was improved from:
(4000 BatchInserts) 17.16s 4289178 ns/op 412893 B/op 4913 allocs/op
To:
(4000 BatchInserts) 9.16s 2288807 ns/op 412142 B/op 4899 allocs/op
* Support migration of varying length varchar postgres
* update type
* fix type
* improve type
* remove not needed change
* fix failing test
* add inspect test
* add more tests
* go fmt
* fix pr comment
Allows for HasNeighbors' selector to be a generic selector instead of *SelectTable.
A use case for this is doing HasNeighbors* function on materialized queries instead
of on concrete tables only.
Also, for some reason, the TimeMixin.UpdateTime was an immutable field,
but this was incorrent, because the codegen just skip generating
update setters to it. Removing the Immutable modifier allows users
to set this field explicitly.
In PostgreSQL, every statement is executed within a transaction. Therefore, we can avoid
creating transaction blocks manually (group of statements surrounded by BEGIN and COMMIT)
for UpdateNodes operation with a single UPDATE statement.
Benchmark for 2000 operations was improved from:
7.98s 3992160 ns/op 4887 B/op 116 allocs/op
To:
4.42s 2209659 ns/op 4435 B/op 104 allocs/op
---
MySQL and SQLite share the same behavior. Please see #1858 for more info.
In PostgreSQL, every statement is executed within a transaction. Therefore, we can avoid
creating transaction blocks manually (group of statements surrounded by BEGIN and COMMIT)
for DeleteNodes operation as it's implemented with a single statement.
Benchmark for 4000 operations was improved from:
14.54s 7270455 ns/op 3702 B/op 81 allocs/op
To:
5.36s 2679935 ns/op 2864 B/op 59 allocs/op
---
MySQL and SQLite share the same behavior. Please see https://github.com/ent/ent/pull/1858
for more info.