Also, added additional example where an edge schema has another edge
to a type that holds an information about the relationship.
The only reason this example exists is to allow users to reduce the storage
occupied by the join-table and allow connect (via M2O) multiple edge-schemas
to an 'information'/'description' node.
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
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.
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.
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:
(2000 Inserts) 8.41s 4206748 ns/op 4595 B/op 115 allocs/op
To:
(2000 Inserts) 4.66s 2330222 ns/op 4107 B/op 104 allocs/op
* dialect/sql/sqlgraph: adding unit tests for IsConstraintError group of checks in second phase of #1310
* renaming test for loop variable names
* use backtick strings to improve readability