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

Method loadAssets

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

Source from the content-addressed store, hash-verified

286}
287
288func (s *Store) loadAssets(ctx context.Context) ([]Asset, error) {
289 rows, err := s.db.QueryContext(
290 ctx,
291 `SELECT position, name, link, image
292 FROM current_assets
293 ORDER BY position`,
294 )
295 if err != nil {
296 return nil, err
297 }
298 defer rows.Close()
299
300 var result []Asset
301 for rows.Next() {
302 var (
303 position int64
304 name sql.NullString
305 link string
306 image sql.NullString
307 )
308
309 if err := rows.Scan(&position, &name, &link, &image); err != nil {
310 return nil, err
311 }
312
313 _ = position
314 record := Asset{Link: link}
315 if name.Valid {
316 value := name.String
317 record.Name = &value
318 }
319 if image.Valid {
320 value := image.String
321 record.Image = &value
322 }
323 result = append(result, record)
324 }
325
326 return result, rows.Err()
327}
328
329func (s *Store) loadDeadline(ctx context.Context) (any, error) {
330 var raw string

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