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

Function insertChannelSubscriptions

internal/store/sqlite/store.go:407–420  ·  view source on GitHub ↗
(ctx context.Context, tx *sql.Tx, items []ChannelSubscription)

Source from the content-addressed store, hash-verified

405}
406
407func insertChannelSubscriptions(ctx context.Context, tx *sql.Tx, items []ChannelSubscription) error {
408 stmt, err := tx.PrepareContext(ctx, `INSERT INTO channel_subscriptions(channel_id, shown_assets, locale) VALUES(?, ?, ?)`)
409 if err != nil {
410 return err
411 }
412 defer stmt.Close()
413
414 for _, item := range items {
415 if _, err := stmt.ExecContext(ctx, item.ID, boolToInt(item.ShownAssets), item.Locale); err != nil {
416 return err
417 }
418 }
419 return nil
420}
421
422func insertGuildConfigs(ctx context.Context, tx *sql.Tx, items []GuildConfig) error {
423 stmt, err := tx.PrepareContext(ctx, `INSERT INTO guild_configs(guild_id, channel_id, thread_id, shown_assets, locale, mention_role_id, enabled, include_images) VALUES(?, ?, ?, ?, ?, ?, ?, ?)`)

Callers 1

replaceLegacySnapshotFunction · 0.85

Calls 2

boolToIntFunction · 0.85
CloseMethod · 0.65

Tested by

no test coverage detected