MCPcopy Create free account
hub / github.com/MMadmer/EpicAssetsNotifyBot / loadUserProfiles

Method loadUserProfiles

internal/store/sqlite/store.go:256–286  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

254}
255
256func (s *Store) loadUserProfiles(ctx context.Context) ([]UserProfile, error) {
257 rows, err := s.db.QueryContext(
258 ctx,
259 `SELECT user_id, shown_assets, locale, subscribed
260 FROM user_profiles
261 ORDER BY user_id`,
262 )
263 if err != nil {
264 return nil, err
265 }
266 defer rows.Close()
267
268 var result []UserProfile
269 for rows.Next() {
270 var (
271 record UserProfile
272 shownAssets int
273 subscribed int
274 )
275
276 if err := rows.Scan(&record.ID, &shownAssets, &record.Locale, &subscribed); err != nil {
277 return nil, err
278 }
279
280 record.ShownAssets = shownAssets != 0
281 record.Subscribed = subscribed != 0
282 result = append(result, record)
283 }
284
285 return result, rows.Err()
286}
287
288func (s *Store) loadAssets(ctx context.Context) ([]Asset, error) {
289 rows, err := s.db.QueryContext(

Callers 1

LoadSnapshotMethod · 0.95

Implementers 2

Storeinternal/store/sqlite/store.go
sqliteAdapterinternal/app/bootstrap.go

Calls 1

CloseMethod · 0.65

Tested by

no test coverage detected