MCPcopy
hub / github.com/dropbox/godropbox / ConvertAssignRow

Function ConvertAssignRow

database/sqltypes/sqltypes.go:301–317  ·  view source on GitHub ↗

ConvertAssignRow copies a row of values in the list of destinations. An error is returned if any one of the row's element coping is done between incompatible value and dest types. The list of destinations must contain pointers. Note that for anything else than *[]byte the value is copied, however

(row []Value, dest ...interface{})

Source from the content-addressed store, hash-verified

299// the destination is of type *[]byte it will point the same []byte array as
300// the source (no copying).
301func ConvertAssignRow(row []Value, dest ...interface{}) error {
302 if len(row) != len(dest) {
303 return errors.Newf(
304 "# of row entries %d does not match # of destinations %d",
305 len(row),
306 len(dest))
307 }
308
309 for i := 0; i < len(row); i++ {
310 err := ConvertAssign(row[i], dest[i])
311 if err != nil {
312 return err
313 }
314 }
315
316 return nil
317}
318
319// ConvertAssign copies to the '*dest' the value in 'src'. An error is returned
320// if the coping is done between incompatible Value and dest types. 'dest' must be

Callers 2

TestConvertAssignRowFunction · 0.85

Calls 2

NewfFunction · 0.92
ConvertAssignFunction · 0.85

Tested by 2

TestConvertAssignRowFunction · 0.68