mirror of
https://github.com/turbot/steampipe.git
synced 2026-02-23 08:00:51 -05:00
Fix prepared statement creation failure when installing a fresh db from a mod folder - ensure the search path has been set before calling EnsureSessionData. Closes #2028
This commit is contained in:
@@ -68,6 +68,13 @@ func (c *DbClient) AcquireSession(ctx context.Context) (sessionResult *db_common
|
||||
return sessionResult
|
||||
}
|
||||
|
||||
// update required session search path if needed
|
||||
err = c.ensureSessionSearchPath(ctx, session)
|
||||
if err != nil {
|
||||
sessionResult.Error = err
|
||||
return sessionResult
|
||||
}
|
||||
|
||||
if !session.Initialized {
|
||||
session.LifeCycle.Add("queued_for_init")
|
||||
|
||||
@@ -93,13 +100,6 @@ func (c *DbClient) AcquireSession(ctx context.Context) (sessionResult *db_common
|
||||
session.Initialized = true
|
||||
}
|
||||
|
||||
// update required session search path if needed
|
||||
err = c.ensureSessionSearchPath(ctx, session)
|
||||
if err != nil {
|
||||
sessionResult.Error = err
|
||||
return sessionResult
|
||||
}
|
||||
|
||||
// now write back to the map
|
||||
c.sessionsMutex.Lock()
|
||||
c.sessions[backendPid] = session
|
||||
|
||||
@@ -9,7 +9,6 @@ type SessionDataSource struct {
|
||||
IntrospectionTableSource func() *modconfig.ModResources
|
||||
}
|
||||
|
||||
// TODO [report] change this to accept a list of queries instead of and create the cut down preparedStatementSource here
|
||||
// NewSessionDataSource uses the workspace and (optionally) a separate the prepared statemeot source
|
||||
// and returns a SessionDataSource
|
||||
// NOTE: preparedStatementSource is only set if specific queries have ben passed to the query command
|
||||
|
||||
Reference in New Issue
Block a user