MCPcopy Create free account
hub / github.com/PostHog/duckgres / ExecContext

Method ExecContext

server/conn_test.go:1534–1549  ·  view source on GitHub ↗
(_ context.Context, query string, _ ...any)

Source from the content-addressed store, hash-verified

1532 execContextQueries []string
1533 noopProfiling
1534 execQueries []string
1535}
1536
1537func (e *abortedAlterViewRecoveryExecutor) QueryContext(context.Context, string, ...any) (RowSet, error) {
1538 return nil, errors.New("not implemented")
1539}
1540
1541func (e *abortedAlterViewRecoveryExecutor) ExecContext(_ context.Context, query string, _ ...any) (ExecResult, error) {
1542 e.execContextQueries = append(e.execContextQueries, query)
1543 switch strings.TrimSpace(strings.ToUpper(query)) {
1544 case "ROLLBACK":
1545 return &fakeExecResult{}, nil
1546 case "ALTER TABLE SOME_VIEW RENAME TO RENAMED_VIEW":
1547 // Count attempts explicitly: statements and ROLLBACK now share
1548 // ExecContext, so a positional index is no longer a reliable
1549 // first-attempt signal.
1550 e.alterAttempts++
1551 if e.alterAttempts == 1 {
1552 return nil, errors.New("TransactionContext Error: Current transaction is aborted (please ROLLBACK)")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected