Fix Postgres error "cached plan must not change result type" when dynamic plugin schema changes. Update interactive .inspect and autocomplete based on changes to connection config or dynamic schema updates. Closes #3184. Closes #3185

This commit is contained in:
kaidaguerre
2023-03-03 18:45:40 +00:00
committed by GitHub
parent a605025b72
commit 2171ce66ba
18 changed files with 217 additions and 60 deletions

View File

@@ -3,7 +3,6 @@ package interactive
import (
"context"
"fmt"
"github.com/turbot/steampipe/pkg/statushooks"
"log"
"time"
@@ -12,6 +11,7 @@ import (
"github.com/turbot/steampipe/pkg/constants"
"github.com/turbot/steampipe/pkg/db/db_common"
"github.com/turbot/steampipe/pkg/error_helpers"
"github.com/turbot/steampipe/pkg/statushooks"
"github.com/turbot/steampipe/pkg/workspace"
)
@@ -59,6 +59,7 @@ func (c *InteractiveClient) handleInitResult(ctx context.Context, initResult *db
c.interactivePrompt.Render()
}
// initialise autocomplete suggestions
c.initialiseSuggestions()
// tell the workspace to reset the prompt after displaying async filewatcher messages
c.initData.Workspace.SetOnFileWatcherEventMessages(func() {
@@ -99,6 +100,11 @@ func (c *InteractiveClient) readInitDataStream(ctx context.Context) {
c.initData.Result.Error = err
}
}
// create a cancellation context used to cancel the listen thread when we exit
listenCtx, cancel := context.WithCancel(ctx)
go c.listenToPgNotifications(listenCtx)
c.cancelNotificationListener = cancel
}
func (c *InteractiveClient) workspaceWatcherErrorHandler(ctx context.Context, err error) {