Skip to content

Commit

Permalink
proofread fixes (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsmyth authored Oct 22, 2024
1 parent 157e600 commit 0a2ede4
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 23 deletions.
2 changes: 1 addition & 1 deletion docs/build/mod-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ variable "mandatory_tag_keys" {
}
```

If a variable does not define a `default`, the user will be prompted for its value when flowpipe starts. If a variable defines a `default`, the user is not prompted and the default value is used if the variable is not explicitly set.
If a variable does not define a `default`, the user will be prompted for its value when Flowpipe starts. If a variable defines a `default`, the user is not prompted and the default value is used if the variable is not explicitly set.

You may also provide a `description` of the variable. The description helps to provide information about the intent and format of the variable to the user of the mod. The description is included when the user is prompted for a variable's value.

Expand Down
33 changes: 16 additions & 17 deletions docs/flowpipe-hcl/step/query.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down Expand Up @@ -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;"
}
}
```
```
2 changes: 1 addition & 1 deletion docs/flowpipe-hcl/trigger/query.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/config-files/connection/duckdb.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ connection "duckdb" "duckdb_connection" {
| `filename` | String | Optional | Path to a DuckDB database file to open. The filename is relative to the [mod location](/docs/run#mod-location)


All arguments are optional, and a `postgres` connection with no arguments will behave the same as the [default connection](#default-connection).
All arguments are optional, and a `duckdb` connection with no arguments will behave the same as the [default connection](#default-connection).

## Attributes (Read-Only)

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/config-files/connection/sqlite.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ connection "sqlite" "sqlite_connection" {
|------------|---------|----------|-------------------
| `filename` | String | Optional | Path to a SQLite database file to open. The filename is relative to the [mod location](/docs/run#mod-location)

All arguments are optional, and a `postgres` connection with no arguments will behave the same as the [default connection](#default-connection).
All arguments are optional, and a `sqlite` connection with no arguments will behave the same as the [default connection](#default-connection).


## Attributes (Read-Only)
Expand Down
3 changes: 1 addition & 2 deletions docs/run/connections.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ sidebar_label: Connections

# Managing Connections

Flowpipe **Connections** provide a mechanism for defining and sharing secrets in your Flowpipe environment.

Flowpipe **Connections** provide a mechanism for defining credentials and options for interacting with external systems.

## Defining / Declaring Connections
`connection` is a top-level resource in a config file (.fpc). Connections are defined in configuration files (`.fpc`), NOT mod files (`.fp`). Like `workspace`, a `connection` can be defined in any .fpc file in the config directory (`~/.flowpipe/config/*.fpc`) or in the root of the `mod-location` (usually `$PWD/*.fpc`).
Expand Down

0 comments on commit 0a2ede4

Please sign in to comment.