MCPcopy
hub / github.com/go-gorp/gorp / AddTable

Method AddTable

db.go:212–214  ·  view source on GitHub ↗

AddTable registers the given interface type with gorp. The table name will be given the name of the TypeOf(i). You must call this function, or AddTableWithName, for any struct type you wish to persist with the given DbMap. This operation is idempotent. If i's type is already mapped, the existing *

(i interface{})

Source from the content-addressed store, hash-verified

210// This operation is idempotent. If i's type is already mapped, the
211// existing *TableMap is returned
212func (m *DbMap) AddTable(i interface{}) *TableMap {
213 return m.AddTableWithName(i, "")
214}
215
216// AddTableWithName has the same behavior as AddTable, but sets
217// table.TableName to name.

Callers 13

TestCustomDateTypeFunction · 0.80
TestUIntPrimaryKeyFunction · 0.80
TestSetUniqueTogetherFunction · 0.80
TestPersistentUserFunction · 0.80
TestNamedQueryMapFunction · 0.80
TestNamedQueryStructFunction · 0.80
TestOverrideVersionColFunction · 0.80
TestDoubleAddTableFunction · 0.80
TestColumnPropsFunction · 0.80
TestEmbeddedTimeFunction · 0.80

Calls 1

AddTableWithNameMethod · 0.95

Tested by 13

TestCustomDateTypeFunction · 0.64
TestUIntPrimaryKeyFunction · 0.64
TestSetUniqueTogetherFunction · 0.64
TestPersistentUserFunction · 0.64
TestNamedQueryMapFunction · 0.64
TestNamedQueryStructFunction · 0.64
TestOverrideVersionColFunction · 0.64
TestDoubleAddTableFunction · 0.64
TestColumnPropsFunction · 0.64
TestEmbeddedTimeFunction · 0.64