(subscriptionConfig *SubscriptionConfig)
| 218 | } |
| 219 | |
| 220 | func (h *ConnectionHandler) executeDrop(subscriptionConfig *SubscriptionConfig) error { |
| 221 | sqlCtx, err := h.duckHandler.sm.NewContextWithQuery(context.Background(), h.mysqlConn, "") |
| 222 | if err != nil { |
| 223 | return fmt.Errorf("failed to create context for query: %w", err) |
| 224 | } |
| 225 | |
| 226 | if err = logrepl.DeleteSubscription(sqlCtx, subscriptionConfig.SubscriptionName); err != nil { |
| 227 | return fmt.Errorf("failed to delete subscription: %w", err) |
| 228 | } |
| 229 | |
| 230 | if err = adapter.CommitAndCloseTxn(sqlCtx); err != nil { |
| 231 | return err |
| 232 | } |
| 233 | |
| 234 | if err = logrepl.UpdateSubscriptions(sqlCtx); err != nil { |
| 235 | return fmt.Errorf("failed to update subscriptions: %w", err) |
| 236 | } |
| 237 | |
| 238 | return nil |
| 239 | } |
| 240 | |
| 241 | func (h *ConnectionHandler) executeCreate(subscriptionConfig *SubscriptionConfig) error { |
| 242 | sqlCtx, err := h.duckHandler.sm.NewContextWithQuery(context.Background(), h.mysqlConn, "") |
no test coverage detected