-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
20 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,7 @@ pipeline "enabled_regions" { | |
| -----------| ------ | --------- | ---------------------------------------------------- | ||
| `sql` | String | Required | A SQL query string. | ||
| `args` | List | Optional | A list of arguments to pass to the query. | ||
| `database` | String | Optional | A connection string used to connect to the database. If not set, the default set in the [mod `database`](/docs/flowpipe-hcl/mod) will be used. The `database` may be a connection reference (`connection.steampipe.default`), a connection string (`postgres://[email protected]:9193/steampipe`), or a Pipes workspace (`acme/anvils`). | ||
| `database` | String | Optional | The database to query. This may be a connection reference (`connection.steampipe.default`), a connection string (`postgres://[email protected]:9193/steampipe`), or a Pipes workspace (`acme/anvils`). If not set, the default set in the [mod `database`](/docs/flowpipe-hcl/mod) will be used. | ||
|
||
This step also supports the [common step arguments](/docs/flowpipe-hcl/step#common-step-arguments) and [attributes](/docs/flowpipe-hcl/step#common-step-attributes-read-only). | ||
|
||
|
@@ -255,29 +255,29 @@ database = "duckdb://my_ducks.db" | |
|
||
### MySQL Query | ||
|
||
The MySQL connection string supports the syntax of the [GO SQL driver for MySQL](https://github.com/go-sql-driver/mysql?tab=readme-ov-file#examples): | ||
|
||
You can use a [MySQL connection](/docs/reference/config-files/connection/mysql) to connect to a MySQL database: | ||
|
||
```hcl | ||
pipeline "mysql_query" { | ||
step "query" "step_1" { | ||
database = connection.mysql.default | ||
sql = "select host, user from user;" | ||
} | ||
} | ||
``` | ||
|
||
Or pass a connection string directly. The MySQL connection string supports the syntax of the [GO SQL driver for MySQL](https://github.com/go-sql-driver/mysql?tab=readme-ov-file#examples): | ||
|
||
```bash | ||
mysql://[user[:password]@]network-location[:port][/dbname][?param1=value1&...] | ||
``` | ||
|
||
```hcl | ||
pipeline "mysql_query" { | ||
step "query" "step_1" { | ||
database = "mysql://root:my_pass@tcp(localhost)/mysql" | ||
sql = <<EOQ | ||
select | ||
host, | ||
user | ||
from | ||
user; | ||
EOQ | ||
} | ||
output "results" { | ||
value = step.query.step_1.rows | ||
sql = "select host, user from user;" | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters