MCPcopy Index your code
hub / github.com/dropbox/godropbox / ConvertAssignRowNullable

Function ConvertAssignRowNullable

database/sqltypes/sqltypes.go:268–292  ·  view source on GitHub ↗

ConverAssignRowNullable is the same as ConvertAssignRow except that it allows nil as a value for the row or any of the row values. In thoses cases, the corresponding values are ignored.

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

Source from the content-addressed store, hash-verified

266// nil as a value for the row or any of the row values. In thoses cases, the
267// corresponding values are ignored.
268func ConvertAssignRowNullable(row []Value, dest ...interface{}) error {
269 if len(row) != len(dest) {
270 return errors.Newf(
271 "# of row entries %d does not match # of destinations %d",
272 len(row),
273 len(dest))
274 }
275
276 if row == nil {
277 return nil
278 }
279
280 for i := 0; i < len(row); i++ {
281 if row[i].IsNull() {
282 continue
283 }
284
285 err := ConvertAssign(row[i], dest[i])
286 if err != nil {
287 return err
288 }
289 }
290
291 return nil
292}
293
294// ConvertAssignRow copies a row of values in the list of destinations. An
295// error is returned if any one of the row's element coping is done between

Callers

nothing calls this directly

Calls 3

NewfFunction · 0.92
ConvertAssignFunction · 0.85
IsNullMethod · 0.80

Tested by

no test coverage detected