MCPcopy Index your code
hub / github.com/Masterminds/structable / Insert

Method Insert

structable.go:387–394  ·  view source on GitHub ↗

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.

()

Source from the content-addressed store, hash-verified

385// This operation is particularly sensitive to DB differences in cases where AUTO_INCREMENT is set
386// on a member of the Record.
387func (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.
397func (s *DbRecorder) insertStd() error {

Callers

nothing calls this directly

Calls 2

insertPgMethod · 0.95
insertStdMethod · 0.95

Tested by

no test coverage detected