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

Method All

database/gdb/gdb_model_select.go:29–32  ·  view source on GitHub ↗

All does "SELECT FROM ..." statement for the model. It retrieves the records from table and returns the result as slice type. It returns nil if there's no record retrieved with the given conditions from table. The optional parameter `where` is the same as the parameter of Model.Where function, see

(where ...any)

Source from the content-addressed store, hash-verified

27// The optional parameter `where` is the same as the parameter of Model.Where function,
28// see Model.Where.
29func (m *Model) All(where ...any) (Result, error) {
30 var ctx = m.GetCtx()
31 return m.doGetAll(ctx, SelectTypeDefault, false, where...)
32}
33
34// AllAndCount retrieves all records and the total count of records from the model.
35// If useFieldForCount is true, it will use the fields specified in the model for counting;

Callers 15

ScanListMethod · 0.95
Test_DB_ToJsonFunction · 0.80
Test_DB_ToStringMapFunction · 0.80
Test_DB_ToIntMapFunction · 0.80
Test_DB_ToUintMapFunction · 0.80
Test_DB_ToStringRecordFunction · 0.80
Test_DB_ToIntRecordFunction · 0.80
Test_DB_ToUintRecordFunction · 0.80
Test_DB_TableFieldFunction · 0.80
Test_Model_InnerJoinFunction · 0.80
Test_Model_LeftJoinFunction · 0.80
Test_TableNameIsKeywordFunction · 0.80

Calls 2

GetCtxMethod · 0.95
doGetAllMethod · 0.95

Tested by 15

Test_DB_ToJsonFunction · 0.64
Test_DB_ToStringMapFunction · 0.64
Test_DB_ToIntMapFunction · 0.64
Test_DB_ToUintMapFunction · 0.64
Test_DB_ToStringRecordFunction · 0.64
Test_DB_ToIntRecordFunction · 0.64
Test_DB_ToUintRecordFunction · 0.64
Test_DB_TableFieldFunction · 0.64
Test_Model_InnerJoinFunction · 0.64
Test_Model_LeftJoinFunction · 0.64
Test_TableNameIsKeywordFunction · 0.64
Test_Model_BatchFunction · 0.64