Merge pull request #294 from aca/master

add json tag to edges
This commit is contained in:
Alex Snast
2020-01-18 18:23:45 +02:00
committed by GitHub
29 changed files with 30 additions and 30 deletions

File diff suppressed because one or more lines are too long

View File

@@ -28,7 +28,7 @@ type {{ $.Name }} struct {
// {{ $e.StructField }} holds the value of the {{ $e.Name }} edge.
{{ $e.StructField }} {{ if not $e.Unique }}[]{{ end }}*{{ $e.Type.Name }} {{ with $e.StructTag }}`{{ . }}`{{ end }}
{{- end }}
}
} `json:"edges"`
{{- end -}}
{{- /* Additional fields to add by the storage driver. */}}
{{- $tmpl := printf "dialect/%s/model/fields" $.Storage }}

View File

@@ -24,7 +24,7 @@ type Group struct {
Edges struct {
// Users holds the value of the users edge.
Users []*User
}
} `json:"edges"`
}
// scanValues returns the types for scanning values from sql.Rows.

View File

@@ -28,7 +28,7 @@ type User struct {
Parent *User
// Children holds the value of the children edge.
Children []*User
}
} `json:"edges"`
parent_id *int
}

View File

@@ -36,7 +36,7 @@ type Card struct {
Owner *User
// Spec holds the value of the spec edge.
Spec []*Spec
}
} `json:"edges"`
owner_id *string
// StaticField defined by templates.

View File

@@ -35,7 +35,7 @@ type File struct {
Owner *User
// Type holds the value of the type edge.
Type *FileType
}
} `json:"edges"`
type_id *string
group_file_id *string
owner_id *string

View File

@@ -27,7 +27,7 @@ type FileType struct {
Edges struct {
// Files holds the value of the files edge.
Files []*File
}
} `json:"edges"`
}
// scanValues returns the types for scanning values from sql.Rows.

View File

@@ -42,7 +42,7 @@ type Group struct {
Users []*User
// Info holds the value of the info edge.
Info *GroupInfo
}
} `json:"edges"`
info_id *string
}

View File

@@ -29,7 +29,7 @@ type GroupInfo struct {
Edges struct {
// Groups holds the value of the groups edge.
Groups []*Group
}
} `json:"edges"`
}
// scanValues returns the types for scanning values from sql.Rows.

View File

@@ -29,7 +29,7 @@ type Node struct {
Prev *Node
// Next holds the value of the next edge.
Next *Node
}
} `json:"edges"`
prev_id *string
}

View File

@@ -29,7 +29,7 @@ type Pet struct {
Team *User
// Owner holds the value of the owner edge.
Owner *User
}
} `json:"edges"`
owner_id *string
team_id *string
}

View File

@@ -25,7 +25,7 @@ type Spec struct {
Edges struct {
// Card holds the value of the card edge.
Card []*Card
}
} `json:"edges"`
}
// scanValues returns the types for scanning values from sql.Rows.

View File

@@ -61,7 +61,7 @@ type User struct {
Children []*User
// Parent holds the value of the parent edge.
Parent *User
}
} `json:"edges"`
group_blocked_id *string
user_spouse_id *string
parent_id *string

View File

@@ -35,7 +35,7 @@ type Card struct {
Owner *User
// Spec holds the value of the spec edge.
Spec []*Spec
}
} `json:"edges"`
// StaticField defined by templates.
StaticField string `json:"boring,omitempty"`

View File

@@ -34,7 +34,7 @@ type File struct {
Owner *User
// Type holds the value of the type edge.
Type *FileType
}
} `json:"edges"`
}
// FromResponse scans the gremlin response data into File.

View File

@@ -26,7 +26,7 @@ type FileType struct {
Edges struct {
// Files holds the value of the files edge.
Files []*File
}
} `json:"edges"`
}
// FromResponse scans the gremlin response data into FileType.

View File

@@ -41,7 +41,7 @@ type Group struct {
Users []*User
// Info holds the value of the info edge.
Info *GroupInfo
}
} `json:"edges"`
}
// FromResponse scans the gremlin response data into Group.

View File

@@ -28,7 +28,7 @@ type GroupInfo struct {
Edges struct {
// Groups holds the value of the groups edge.
Groups []*Group
}
} `json:"edges"`
}
// FromResponse scans the gremlin response data into GroupInfo.

View File

@@ -28,7 +28,7 @@ type Node struct {
Prev *Node
// Next holds the value of the next edge.
Next *Node
}
} `json:"edges"`
}
// FromResponse scans the gremlin response data into Node.

View File

@@ -28,7 +28,7 @@ type Pet struct {
Team *User
// Owner holds the value of the owner edge.
Owner *User
}
} `json:"edges"`
}
// FromResponse scans the gremlin response data into Pet.

View File

@@ -24,7 +24,7 @@ type Spec struct {
Edges struct {
// Card holds the value of the card edge.
Card []*Card
}
} `json:"edges"`
}
// FromResponse scans the gremlin response data into Spec.

View File

@@ -61,7 +61,7 @@ type User struct {
Children []*User
// Parent holds the value of the parent edge.
Parent *User
}
} `json:"edges"`
}
// FromResponse scans the gremlin response data into User.

View File

@@ -30,7 +30,7 @@ type User struct {
Followers []*User
// Following holds the value of the following edge.
Following []*User
}
} `json:"edges"`
user_spouse_id *uint64
}

View File

@@ -24,7 +24,7 @@ type Car struct {
Edges struct {
// Owner holds the value of the owner edge.
Owner *User
}
} `json:"edges"`
owner_id *int
}

View File

@@ -44,7 +44,7 @@ type User struct {
Spouse *User
// Car holds the value of the car edge.
Car *Car
}
} `json:"edges"`
parent_id *int
user_spouse_id *int
}

View File

@@ -24,7 +24,7 @@ type Car struct {
Edges struct {
// Owner holds the value of the owner edge.
Owner *User
}
} `json:"edges"`
owner_id *int
}

View File

@@ -42,7 +42,7 @@ type User struct {
Edges struct {
// Car holds the value of the car edge.
Car []*Car
}
} `json:"edges"`
}
// scanValues returns the types for scanning values from sql.Rows.

View File

@@ -29,7 +29,7 @@ type Pet struct {
Edges struct {
// Owner holds the value of the owner edge.
Owner *User
}
} `json:"edges"`
owner_id *int
}

View File

@@ -28,7 +28,7 @@ type User struct {
Pets []*Pet
// Friends holds the value of the friends edge.
Friends []*User
}
} `json:"edges"`
}
// scanValues returns the types for scanning values from sql.Rows.