(ctx context.Context, tx *sql.Tx, items []ChannelSubscription)
| 405 | } |
| 406 | |
| 407 | func 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 | |
| 422 | func 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(?, ?, ?, ?, ?, ?, ?, ?)`) |
no test coverage detected