MCPcopy Create free account
hub / github.com/apecloud/myduckserver / executeDrop

Method executeDrop

pgserver/subscription_handler.go:220–239  ·  view source on GitHub ↗
(subscriptionConfig *SubscriptionConfig)

Source from the content-addressed store, hash-verified

218}
219
220func (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
241func (h *ConnectionHandler) executeCreate(subscriptionConfig *SubscriptionConfig) error {
242 sqlCtx, err := h.duckHandler.sm.NewContextWithQuery(context.Background(), h.mysqlConn, "")

Callers 1

Calls 3

DeleteSubscriptionFunction · 0.92
CommitAndCloseTxnFunction · 0.92
UpdateSubscriptionsFunction · 0.92

Tested by

no test coverage detected