MCPcopy
hub / github.com/ent/ent / values

Method values

dialect/sql/sqlgraph/graph_test.go:1684–1697  ·  view source on GitHub ↗
(columns []string)

Source from the content-addressed store, hash-verified

1682}
1683
1684func (*user) values(columns []string) ([]any, error) {
1685 values := make([]any, len(columns))
1686 for i := range columns {
1687 switch c := columns[i]; c {
1688 case "id", "age", "best_friend_id", "fk1", "fk2":
1689 values[i] = &sql.NullInt64{}
1690 case "name":
1691 values[i] = &sql.NullString{}
1692 default:
1693 return nil, fmt.Errorf("unexpected column %q", c)
1694 }
1695 }
1696 return values, nil
1697}
1698
1699func (u *user) assign(columns []string, values []any) error {
1700 if len(columns) != len(values) {

Callers 2

TestQueryNodesFunction · 0.95
TestQueryNodesSchemaFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected