MCPcopy Create free account
hub / github.com/dgraph-io/dgraph / outputRow

Method outputRow

dgraph/cmd/migrate/dump.go:196–204  ·  view source on GitHub ↗

outputRow takes a row with its metadata as well as the table metadata, and spits out one or more RDF entries to the dumpMeta's dataWriter. Consider the following table "salary" person_company varchar (50) person_employee_id int salary float foreign key (person_company, person_employee_id) references

(row *sqlRow, tableInfo *sqlTable)

Source from the content-addressed store, hash-verified

194// _:person_company_Google_employee_id_100 to the foreign blank node _:person_2
195// is recorded through the person table's valuesRecorder.
196func (m *dumpMeta) outputRow(row *sqlRow, tableInfo *sqlTable) {
197 for i, colValue := range row.values {
198 colName := tableInfo.columnNames[i]
199 if !tableInfo.isForeignKey[colName] {
200 predicate := tableInfo.predNames[i]
201 m.outputPlainCell(row.blankNodeLabel, predicate, tableInfo.columnDataTypes[i], colValue)
202 }
203 }
204}
205
206func (m *dumpMeta) outputConstraints(row *sqlRow, tableInfo *sqlTable) {
207 for _, constraint := range tableInfo.foreignKeyConstraints {

Callers 1

dumpTableMethod · 0.95

Calls 1

outputPlainCellMethod · 0.95

Tested by

no test coverage detected