Skip to content
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

Merged
merged 10 commits into from
Dec 7, 2021

Conversation

binaek
Copy link
Contributor

@binaek binaek commented Nov 25, 2021

@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

@binaek binaek self-assigned this Nov 25, 2021
@binaek binaek linked an issue Nov 25, 2021 that may be closed by this pull request
@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update comment?

@@ -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 {
Copy link
Contributor

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?

for _, extn := range extensions {
_, err = rootClient.Exec(fmt.Sprintf("create extension if not exists %s", db_common.PgEscapeName(extn)))
if err != nil {
errorLock.Lock()
Copy link
Contributor

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

@kaidaguerre kaidaguerre merged commit b92ff8a into main Dec 7, 2021
@kaidaguerre kaidaguerre deleted the tablefunc_extension_1154 branch December 7, 2021 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add tablefunc extension to service
3 participants