Bind binds a DbRecorder to a Record. This takes a given structable.Record and binds it to the recorder. That means that the recorder will track all changes to the Record. The table name tells the recorder which database table to link this record to. All storage operations will use that table.
(tableName string, ar Record)
| 282 | // The table name tells the recorder which database table to link this record |
| 283 | // to. All storage operations will use that table. |
| 284 | func (s *DbRecorder) Bind(tableName string, ar Record) Recorder { |
| 285 | |
| 286 | // "To be is to be the value of a bound variable." - W. O. Quine |
| 287 | |
| 288 | // Get the table name |
| 289 | s.table = tableName |
| 290 | |
| 291 | // Get the fields |
| 292 | s.scanFields(ar) |
| 293 | |
| 294 | s.record = ar |
| 295 | |
| 296 | return Recorder(s) |
| 297 | } |
| 298 | |
| 299 | // Key gets the string names of the fields used as primary key. |
| 300 | func (s *DbRecorder) Key() []string { |
nothing calls this directly
no test coverage detected