mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
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
This commit is contained in:
committed by
Facebook Github Bot
parent
83d0063437
commit
c3955a08f1
@@ -12,8 +12,6 @@ import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"github.com/facebookincubator/ent/entc/integration/ent/node"
|
||||
|
||||
"github.com/facebookincubator/ent/dialect"
|
||||
"github.com/facebookincubator/ent/dialect/gremlin"
|
||||
"github.com/facebookincubator/ent/dialect/gremlin/graph/dsl"
|
||||
@@ -21,6 +19,7 @@ import (
|
||||
"github.com/facebookincubator/ent/dialect/gremlin/graph/dsl/g"
|
||||
"github.com/facebookincubator/ent/dialect/gremlin/graph/dsl/p"
|
||||
"github.com/facebookincubator/ent/dialect/sql"
|
||||
"github.com/facebookincubator/ent/entc/integration/ent/node"
|
||||
)
|
||||
|
||||
// NodeCreate is the builder for creating a Node entity.
|
||||
@@ -126,9 +125,9 @@ func (nc *NodeCreate) sqlSave(ctx context.Context) (*Node, error) {
|
||||
return nil, err
|
||||
}
|
||||
builder := sql.Insert(node.Table).Default(nc.driver.Dialect())
|
||||
if nc.value != nil {
|
||||
builder.Set(node.FieldValue, *nc.value)
|
||||
n.Value = *nc.value
|
||||
if value := nc.value; value != nil {
|
||||
builder.Set(node.FieldValue, *value)
|
||||
n.Value = *value
|
||||
}
|
||||
query, args := builder.Query()
|
||||
if err := tx.Exec(ctx, query, args, &res); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user