Insert puts a new record into the database. This operation is particularly sensitive to DB differences in cases where AUTO_INCREMENT is set on a member of the Record.
()
| 385 | // This operation is particularly sensitive to DB differences in cases where AUTO_INCREMENT is set |
| 386 | // on a member of the Record. |
| 387 | func (s *DbRecorder) Insert() error { |
| 388 | switch s.flavor { |
| 389 | case "postgres": |
| 390 | return s.insertPg() |
| 391 | default: |
| 392 | return s.insertStd() |
| 393 | } |
| 394 | } |
| 395 | |
| 396 | // Insert and assume that LastInsertId() returns something. |
| 397 | func (s *DbRecorder) insertStd() error { |