-
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
21 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,8 +36,8 @@ pipeline "enabled_regions" { | |
| Argument | Type | Optional? | Description | ||
| -----------| ------ | --------- | ---------------------------------------------------- | ||
| `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`). | ||
| `args` | List | Optional | A list of arguments to pass to the query. | ||
| `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,28 @@ 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,9 +53,9 @@ On subsequent query trigger runs: | |
|
||
| Argument | Type | Optional? | Description | ||
|---------------|---------|-----------|----------------- | ||
| `database` | String | Required | A connection string used to connect to the database. | ||
| `sql` | String | Required | A SQL query string. | ||
| `description` | String | Optional | A description of the trigger. | ||
| `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. | ||
| `enabled` | Boolean | Optional | Enable or disable the trigger. A disabled trigger will not fire, but it will retain its history and configuration. Default is `true`. | ||
| `param` | Block | Optional | A [param](#parameters) block that defines the parameters that can be passed into the trigger. | ||
| `primary_key` | String | Optional | Primary key to use for update vs insert detection. If no primary key is defined, a hash of the row will be used as the key. | ||
|
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