MCPcopy
hub / github.com/pocketbase/pocketbase / TestRecordQueryAll

Function TestRecordQueryAll

core/record_query_test.go:123–217  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

121}
122
123func TestRecordQueryAll(t *testing.T) {
124 t.Parallel()
125
126 app, _ := tests.NewTestApp()
127 defer app.Cleanup()
128
129 type customStructs struct {
130 Id string `db:"id" json:"id"`
131 }
132
133 type mockRecordProxy struct {
134 core.BaseRecordProxy
135 }
136
137 scenarios := []struct {
138 name string
139 collection string
140 recordIds []any
141 result any
142 }{
143 {
144 "slice of Record models",
145 "demo1",
146 []any{"84nmscqy84lsi1t", "al1h9ijdeojtsjy"},
147 &[]core.Record{},
148 },
149 {
150 "slice of pointer Record models",
151 "demo1",
152 []any{"84nmscqy84lsi1t", "al1h9ijdeojtsjy"},
153 &[]*core.Record{},
154 },
155 {
156 "slice of Record proxies",
157 "demo1",
158 []any{"84nmscqy84lsi1t", "al1h9ijdeojtsjy"},
159 &[]mockRecordProxy{},
160 },
161 {
162 "slice of pointer Record proxies",
163 "demo1",
164 []any{"84nmscqy84lsi1t", "al1h9ijdeojtsjy"},
165 &[]mockRecordProxy{},
166 },
167 {
168 "slice of custom structs",
169 "demo1",
170 []any{"84nmscqy84lsi1t", "al1h9ijdeojtsjy"},
171 &[]customStructs{},
172 },
173 {
174 "slice of pointer custom structs",
175 "demo1",
176 []any{"84nmscqy84lsi1t", "al1h9ijdeojtsjy"},
177 &[]customStructs{},
178 },
179 }
180

Callers

nothing calls this directly

Calls 5

CleanupMethod · 0.95
NewTestAppFunction · 0.92
RecordQueryMethod · 0.65
RunMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…