powerpipe icon indicating copy to clipboard operation
powerpipe copied to clipboard

Backend support is not populated correctly if the database is specified by a connection string

Open knkcni opened this issue 11 months ago • 2 comments

Describe the bug Following --database deprecation in v1.0.0, its not possible to use --var database if you specify a connection string like the documentation specify in docs: selecting a database

Powerpipe version (powerpipe -v) Example: v1.2.5

To reproduce

powerpipe server --var database="postgres://steampipe:PA$$W0RD@steampipe-database:5432/steampipe"

Expected behavior Like specified in #714, powerpipe is supposed to run with a connection string, and allow a really simple on-the-fly start for a powerpipe server.

knkcni avatar May 06 '25 09:05 knkcni

@knkcni Thanks for raising this. Unfortunately, this bug fell off our radar. We will try and fix this asap and get a patch version out. Thanks!

pskrbasu avatar May 06 '25 13:05 pskrbasu

Hi @knkcni,

I took a look and tried reproducing the issue on my end, but I was unable to. Please share more details about your mod and the exact steps you followed so I can dig deeper.

Here's my mod:

I have this simple mod for reproduction. This mod has a database specified through a variable, as mentioned in selecting-a-database.

mod "functionality_test_mod"{
  title = "Functionality test mod"
  description = "This is a simple mod used for testing different steampipe features and funtionalities."
  database = var.database
}

variable "database" {
  type    = connection.postgres
  default = connection.postgres.my_connection
}

The variable database defaults to postgres connection in my ~/.powerpipe/config ppc files - powerpipe connections

connection "postgres" "my_connection" {
   host     = "localhost"
   port     = 5432
   db       = "mydb"
   username = "myuser"
   password = "mypassword123"
}

Now I run my mod specifying the database through the --var argument: powerpipe server --var database="postgres://[email protected]:9193/steampipe" and it behaves correctly by connecting to the provided connection string instead of the default provided in the mod.

This is how it is supposed to work. For more details, you can go through - https://powerpipe.io/docs/build/mod-database.

Let me know how your mod looks and how you are using the database variable in your case. If things are still unclear, please reach out! 😃

Thanks

pskrbasu avatar May 08 '25 09:05 pskrbasu

@knkcni We have verified that this is not an issue. The behavior is correct and working as expected (as per documentation). Hence closing this for now. Feel free to let us know if you're still having issues passing variables.

pskrbasu avatar Jul 10 '25 13:07 pskrbasu