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

Method Bind

structable.go:284–297  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

282// The table name tells the recorder which database table to link this record
283// to. All storage operations will use that table.
284func (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.
300func (s *DbRecorder) Key() []string {

Callers

nothing calls this directly

Calls 2

scanFieldsMethod · 0.95
RecorderInterface · 0.85

Tested by

no test coverage detected