# ExecuteQuery

Required Frends version: 5.5+

Required .NET version: 6.0

Compatible Agents: Crossplatform

Source code: <https://github.com/FrendsPlatform/Frends.MySQL>

{% tabs %}
{% tab title="Parameter: QueryInput" %}

| Name                          | Description                                                                                                                                                                                  |
| ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 🗝ConnectionString : `String` | <p>Mysql connection string.</p><p><br>Default: <code>-</code><br>Example: <code>server=server;user=user;database=db;password=pw;</code></p>                                                  |
| CommandText : `String`        | <p>SQL statement to execute at the data source. Usually query or name of a stored procedure.</p><p><br>Default: <code>-</code><br>Example: <code>SELECT ColumnName FROM TableName</code></p> |
| Parameters : `Parameter[]`    | <p>Parameters for the database query.</p><p><br>Default: <code>-</code><br>Example: <code>foo, bar</code></p>                                                                                |
| {% endtab %}                  |                                                                                                                                                                                              |

{% tab title="Parameter: Options" %}

| Name                                                              | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ----------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| TimeoutSeconds : `Int32`                                          | <p>Timeout value in seconds</p><p><br>Default: <code>30</code><br>Example: <code>30</code></p>                                                                                                                                                                                                                                                                                                                                                                                                     |
| MySqlTransactionIsolationLevel : `MySqlTransactionIsolationLevel` | <p>Transaction isolation level to use.</p><p>Possible values:</p><ul><li><code>RepeatableRead</code>:</li></ul><p>Transaction isolation level to use.</p><ul><li><code>ReadCommitted</code>:</li></ul><p>Transaction isolation level to use.</p><ul><li><code>ReadUncommitted</code>:</li></ul><p>Transaction isolation level to use.</p><ul><li><code>Serializable</code>:</li></ul><p>Transaction isolation level to use.</p><p><br>Default: <code>-</code><br>Example: <code>Default</code></p> |
| ExecuteType : `ExecuteType`                                       | <p>Type of query execution.</p><p>Possible values:</p><ul><li><code>Auto</code>:</li></ul><p>Type of query execution.</p><ul><li><code>NonQuery</code>:</li></ul><p>Type of query execution.</p><ul><li><code>Scalar</code>:</li></ul><p>Type of query execution.</p><ul><li><code>Reader</code>:</li></ul><p>Type of query execution.</p><p><br>Default: <code>1</code><br>Example: <code>Auto</code></p>                                                                                         |
| {% endtab %}                                                      |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |

{% tab title="Result: Result" %}

| Name                    | Description                                                                       |
| ----------------------- | --------------------------------------------------------------------------------- |
| Success : `Boolean`     | <p>Task status.<br>Example: <code>true</code></p>                                 |
| ResultJtoken : `Object` | <p>Result value(s).<br>Example: <code>\[{"name": "foo", "value": 123}]</code></p> |
| {% endtab %}            |                                                                                   |

{% tab title="Changelog" %}

## Changelog

### \[1.4.0] - 2025-12-19

#### Fixed

* Allow defining execute type.
* Fix the issue with respecting timeout.

### \[1.3.0] - 2025-09-22

#### Fixed

* Respect Options.TimeoutSeconds in MySql commands

### \[1.2.0] - 2025-03-18

#### Updated

* Update packages: Dapper 2.1.28 -> 2.1.66 MySqlConnector 2.3.5 -> 2.4.0 coverlet.collector 3.1.2 -> 6.0.4 Microsoft.NET.Test.Sdk 17.1.0 -> 17.13.0 NUnit 3.13.3 -> 4.3.2 NUnit.Analyzers 3.3.0 -> 4.6.0 NUnit3TestAdapter 4.2.1 -> 5.0.0

### \[1.1.0] - 2024-03-07

#### Updated

* Changed MySqlData -library to MySqlConnector -library.

### \[1.0.1] - 2023-01-02

#### Fixed

* Fixed issue with Task's result couldn't be referenced with dot notation by changing the ResultJtoken to dynamic.
* Changed the Newtonsoft.Json version to 12.0.1 to be same what Frends is using.

### \[1.0.0] - 2022-10-12

#### Added

* Initial implementation
  {% endtab %}
  {% endtabs %}
