-
Notifications
You must be signed in to change notification settings - Fork 274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enables the tablefunc
extension for the steampipe
database. Closes #1154
#1184
Conversation
db/db_local/start_services.go
Outdated
@@ -180,6 +181,13 @@ func startDB(port int, listen StartListenType, invoker constants.Invoker) (start | |||
return ServiceFailedToStart, err | |||
} | |||
|
|||
// ensure the foreign server exists in the database |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update comment?
db/db_local/start_services.go
Outdated
@@ -438,6 +446,30 @@ func setupLogCollector(postgresCmd *exec.Cmd) (chan string, func(), error) { | |||
return publishChannel, closeFunction, nil | |||
} | |||
|
|||
// ensures that the necessary extensions are installed on the database | |||
func ensureNecessaryExtns(databaseName string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now ask yourself - what am I going to say about this function name?
274edde
to
b652e9d
Compare
b652e9d
to
7fa20f1
Compare
db/db_local/start_services.go
Outdated
for _, extn := range extensions { | ||
_, err = rootClient.Exec(fmt.Sprintf("create extension if not exists %s", db_common.PgEscapeName(extn))) | ||
if err != nil { | ||
errorLock.Lock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why the lock? this is syncronous
@pskrbasu can you add a couple of tests for this?
Here's the docs to the extension:
https://www.postgresql.org/docs/12/tablefunc.html