MCPcopy
hub / github.com/gogf/gf / createInitTable

Function createInitTable

contrib/drivers/dm/dm_z_unit_init_test.go:163–182  ·  view source on GitHub ↗
(table ...string)

Source from the content-addressed store, hash-verified

161}
162
163func createInitTable(table ...string) (name string) {
164 name = createTable(table...)
165 array := garray.New(true)
166 for i := 1; i <= TableSize; i++ {
167 array.Append(g.Map{
168 "id": i,
169 "account_name": fmt.Sprintf(`name_%d`, i),
170 "pwd_reset": 0,
171 "attr_index": i,
172 "created_time": gtime.Now(),
173 })
174 }
175 result, err := db.Schema(TestDBName).Insert(context.Background(), name, array.Slice())
176 gtest.AssertNil(err)
177
178 n, e := result.RowsAffected()
179 gtest.Assert(e, nil)
180 gtest.Assert(n, TableSize)
181 return
182}
183
184func createTableFalse(table ...string) (name string, err error) {
185 if len(table) > 0 {

Callers 15

Test_WherePri_PR4157Function · 0.70
TestTableFieldsFunction · 0.70
Test_DB_QueryFunction · 0.70
Test_DB_ExecFunction · 0.70
Test_DB_InsertFunction · 0.70
Test_DB_BatchInsertFunction · 0.70
Test_DB_UpdateFunction · 0.70
Test_DB_GetAllFunction · 0.70
Test_DB_GetOneFunction · 0.70

Calls 10

NewFunction · 0.92
NowFunction · 0.92
AssertNilFunction · 0.92
AssertFunction · 0.92
createTableFunction · 0.70
AppendMethod · 0.65
InsertMethod · 0.65
SchemaMethod · 0.65
SliceMethod · 0.45
RowsAffectedMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…