For the complete documentation index, see llms.txt. This page is also available as Markdown.

ExecuteQuery

Execute Snowflake query.

Task version: 2.0.0

Required Frends version: 5.5+

Required .NET version: 6.0

Compatible Agents: Crossplatform

Task Parameters

Name
Description

🗝ConnectionString : String

String that contains the necessary data to connect to the database.

Default: - Example: account=testaccount-123;user=user;role=ACCOUNTADMIN;db=SHOP;schema=PUBLIC; authenticator=SNOWFLAKE_JWT;private_key_file=C:/snow/rsa_key.p8;private_key_pwd=MyStrongPassphrase

CommandType : CommandTypes

Specifies how a command string is interpreted.

ExecuteNonQuery: Executes an SQL statement, and returns the number of rows affected.

ExecuteReader: Executes the query, and returns an object that can iterate over the entire result set.

ExecuteScalar: Executes the query, and returns the first column of the first row in the result set returned by the query. Additional columns or rows are ignored.

Possible values:

  • ExecuteNonQuery: Executes an SQL statement, and returns the number of rows affected.

  • ExecuteReader: Executes the query, and returns an object that can iterate over the entire result set.

  • ExecuteScalar: Executes the query, and returns the first column of the first row in the result set returned by the query. Additional columns or rows are ignored.

Default: - Example: -

CommandText : String

text command to run against the data source.

Default: - Example: SELECT * FROM mytable

PrivateKeyFilePath : String

Full file path to the private key (.p8) used for Snowflake key pair authentication.

Default: - Example: C:\keys\rsa_key.p8

🗝PrivateKeyPassphrase : String

Optional passphrase for the private key file, if the key was generated with encryption.

Leave empty if the key file is unencrypted.

Default: - Example: MySuperSecret123

Name
Description

ThrowExceptionOnError : Boolean

Gets or sets a value indicating whether an error should stop the Task and throw an exception.

If set to true, an exception will be thrown when an error occurs. If set to false, Task will try to continue and the error message will be added into Result.ErrorMessage and Result.Success will be set to false.

Default: True Example: true

TimeOut : Int32

Gets or sets the wait time (in seconds) before terminating the attempt to execute a command and generating an error.

Default: 30 Example: 30

Task Result

Name
Description

Success : Boolean

Gets a value indicating whether the Task was executed successfully. Example: true

RecordsAffected : Int32

Records affected. Some statements will return -1. Example: 100

ErrorMessage : Object

Error message. This value is generated when an exception occurs and Options.ThrowErrorOnFailure = false. Example: Table 'NOTABLE' does not exist or not authorized...

Data : Object

Procedure's result as JToken. Example: Examples using SELECT query Input.ExecuteType = ExecuteReader: [{"NAME": "Jane","AGE": 94},{"NAME": "Eve","AGE": 53}], Input.ExecuteType = NonQuery: null, Input.ExecuteType = Scalar: {"Value": "Jane"}

Task Changelog

Changelog for Task Frends.Snowflake.ExecuteQuery.

[2.0.0] - 2025-09-03

Changed

  • [Breaking] Result now returns a dynamic JToken instead of DataTable when using ExecuteReader mode.

  • Added support for CancellationToken, thus enabling query cancellation.

[1.2.0] - 2025-09-03

Added

  • Added support for Snowflake key pair authentication: Input.PrivateKeyFilePath: full path to the .p8 private key file. Input.PrivateKeyPassphrase: optional passphrase for encrypted private keys.

[1.1.0] - 2025-02-12

Changed

  • Update: Snowflake.Data 2.1.5 -> 4.3.0 MSTest.TestAdapter 3.8.0 -> 3.8.3 MSTest.TestFramework 3.8.0 -> 3.8.3

[1.0.0] - 2024-01-08

Added

  • Initial implementation

Last updated

Was this helpful?