> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# appmixer.snowflake.db.Query

- Component: `appmixer.snowflake.db.Query`
- Kind: Action
- Version: 1.0.0
- Visibility: Public
- Connector: [appmixer.snowflake 1.3.0](https://connectors.appmixer.com/connector/appmixer.snowflake/1.3.0.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.snowflake/1.3.0/component/appmixer.snowflake.db.Query>

Run an arbitrary query against your Snowflake database.

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| Query (`query`) | textarea | The SQL statement to run. Use `?` placeholders for values that come from the flow and fill them in **Parameters**, for example `SELECT * FROM PUBLIC.USERS WHERE EMAIL = ?`. Refer to tables as `SCHEMA.TABLE`; the database comes from the connected account. |
| Parameters (`parameters`) | expression | Values for the `?` placeholders in the query, in order. Use them instead of putting flow variables into the query text. |
| Output Type (`outputType`) | select | Choose whether you want to receive the result set as one complete list, or one row at a time or stream the rows to a file. For large datasets, streaming the rows to a file is the most efficient method. |

## Output ports

### Port `out`

Variables are loaded dynamically from `/component/appmixer/snowflake/db/Query?outPort=out&ignoreAuth=true`.

## Full metadata (component.json)

```json
{
  "name": "appmixer.snowflake.db.Query",
  "author": "Harsha Surisetty <harsha@client.io>",
  "description": "Run an arbitrary query against your Snowflake database.",
  "private": false,
  "auth": {
    "service": "appmixer:snowflake"
  },
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string"
          },
          "outputType": {
            "type": "string",
            "enum": [
              "row",
              "rows",
              "file"
            ],
            "outputTypeModes": {
              "row": "item",
              "rows": "array",
              "file": "file"
            }
          },
          "parameters": {
            "type": "object"
          }
        },
        "required": [
          "query"
        ]
      },
      "inspector": {
        "inputs": {
          "query": {
            "type": "textarea",
            "index": 0,
            "label": "Query",
            "tooltip": "The SQL statement to run. Use <code>?</code> placeholders for values that come from the flow and fill them in <b>Parameters</b>, for example <code>SELECT * FROM PUBLIC.USERS WHERE EMAIL = ?</code>. Refer to tables as <code>SCHEMA.TABLE</code>; the database comes from the connected account."
          },
          "parameters": {
            "type": "expression",
            "index": 1,
            "label": "Parameters",
            "levels": [
              "ADD"
            ],
            "fields": {
              "value": {
                "type": "text",
                "label": "Value",
                "tooltip": "Bound to the next <code>?</code> placeholder in the query. The value is sent separately from the SQL text, so quotes in it cannot break the statement."
              }
            },
            "tooltip": "Values for the <code>?</code> placeholders in the query, in order. Use them instead of putting flow variables into the query text."
          },
          "outputType": {
            "type": "select",
            "options": [
              {
                "content": "One row at a time",
                "value": "row"
              },
              {
                "content": "All rows at once",
                "value": "rows"
              },
              {
                "content": "Stream to file",
                "value": "file"
              }
            ],
            "defaultValue": "file",
            "index": 2,
            "label": "Output Type",
            "tooltip": "Choose whether you want to receive the result set as one complete list, or one row at a time or stream the rows to a file. For large datasets, streaming the rows to a file is the most efficient method."
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "out",
      "source": {
        "url": "/component/appmixer/snowflake/db/Query?outPort=out&ignoreAuth=true",
        "data": {
          "properties": {
            "generateOutputPortOptions": true
          },
          "messages": {
            "in/outputType": "inputs/in/outputType",
            "in/query": "dummy"
          }
        }
      }
    }
  ],
  "icon": "(data URI omitted)"
}
```
