(ref *ref)
| 187 | } |
| 188 | |
| 189 | func createLabel(ref *ref) (string, error) { |
| 190 | parts := make([]string, 0) |
| 191 | parts = append(parts, ref.tableName) |
| 192 | for _, colIdx := range ref.refColumnIndices { |
| 193 | colVal, err := getValue(ref.allColumns[colIdx.name].dataType, |
| 194 | ref.colValues[colIdx.index]) |
| 195 | if err != nil { |
| 196 | return "", err |
| 197 | } |
| 198 | parts = append(parts, colIdx.name, colVal) |
| 199 | } |
| 200 | |
| 201 | return fmt.Sprintf("_:%s", strings.Join(parts, separator)), nil |
| 202 | } |
| 203 | |
| 204 | // createDgraphSchema generates one Dgraph predicate per SQL column |
| 205 | // and the type of the predicate is inferred from the SQL column type. |
no test coverage detected