A Recorder is responsible for managing the persistence of a Record. A Recorder is bound to a struct, which it then examines for fields that should be stored in the database. From that point on, a recorder can manage the persistent lifecycle of the record.
| 188 | // that should be stored in the database. From that point on, a recorder |
| 189 | // can manage the persistent lifecycle of the record. |
| 190 | type Recorder interface { |
| 191 | // Bind this Recorder to a table and to a Record. |
| 192 | // |
| 193 | // The table name is used verbatim. DO NOT TRUST USER-SUPPLIED VALUES. |
| 194 | // |
| 195 | // The struct is examined for tags, and those tags are parsed and used to determine |
| 196 | // details about each field. |
| 197 | Bind(string, Record) Recorder |
| 198 | |
| 199 | Loader |
| 200 | Haecceity |
| 201 | Saver |
| 202 | |
| 203 | // This returns the column names used for the primary key. |
| 204 | //Key() []string |
| 205 | } |
| 206 | |
| 207 | type Loader interface { |
| 208 | // Loads the entire Record using the value of the PRIMARY_KEY(s) |
no outgoing calls
no test coverage detected