Load selects the record from the database and loads the values into the bound Record. Load uses the table's PRIMARY KEY(s) as the sole criterion for matching a record. Essentially, it is akin to `SELECT * FROM table WHERE primary_key = ?`. This modifies the Record in-place. Other than the primary
()
| 315 | // This modifies the Record in-place. Other than the primary key fields, any |
| 316 | // other field will be overwritten by the value retrieved from the database. |
| 317 | func (s *DbRecorder) Load() error { |
| 318 | whereParts := s.whereIds() |
| 319 | dest := s.fieldReferences(false) |
| 320 | |
| 321 | q := s.builder.Select(s.colList(false, false)...).From(s.table).Where(whereParts) |
| 322 | err := q.QueryRow().Scan(dest...) |
| 323 | |
| 324 | return err |
| 325 | } |
| 326 | |
| 327 | // LoadWhere loads an object based on a WHERE clause. |
| 328 | // |
nothing calls this directly
no test coverage detected