FireboltNetSDK 1.6.1
See the version list below for details.
dotnet add package FireboltNetSDK --version 1.6.1
NuGet\Install-Package FireboltNetSDK -Version 1.6.1
<PackageReference Include="FireboltNetSDK" Version="1.6.1" />
<PackageVersion Include="FireboltNetSDK" Version="1.6.1" />
<PackageReference Include="FireboltNetSDK" />
paket add FireboltNetSDK --version 1.6.1
#r "nuget: FireboltNetSDK, 1.6.1"
#:package FireboltNetSDK@1.6.1
#addin nuget:?package=FireboltNetSDK&version=1.6.1
#tool nuget:?package=FireboltNetSDK&version=1.6.1
firebolt-net-sdk
This is an implementation of .NET 6 Core driver for Firebolt in a form of a DbConnection class. Supports all latest .NET frameworks and all platforms.
This project is developed under Visual Studio 2022. Earlier versions of Visual Studio are not supported.
Installing the Package
Here is a FireboltNetSDK NuGet page.
- Install using .NET CLI
dotnet add package FireboltNetSDK
- Install using Visual Studio UI
Tools
>NuGet Package Manager
>Manage NuGet Packages for Solution
and search forFirebolt
- Install using Package Manager Console:
PM> Install-Package FireboltNetSDK
Examples
Following examples demonstrate how to connect and interact with Firebolt database using this driver:
Creating a connection string
// Name of your Firebolt account
string account = "my_firebolt_account";
// Client credentials, that you want to use to connect
string clientId = "my_client_id";
string clientSecret = "my_client_secret";
// Name of database and engine to connect to (Optional)
string database = "my_database_name";
string engine = "my_engine_name";
// Construct a connection string using defined parameter
string conn_string = $"account={account};clientid={clientId};clientsecret={clientSecret};database={database};engine={engine}";
Opening and closing a connection
using FireboltDotNetSdk.Client;
// Create a new connection using generated connection string
using var conn = new FireboltConnection(conn_string);
// Open a connection
conn.Open();
// Execute SQL, fetch data, ...
// Close the connection after all operations are done
conn.Close();
Executing a SQL command that does not return result
// First you would need to create a command
var command = conn.CreateCommand();
// ... and set the SQL query
command.CommandText = "CREATE DATABASE IF NOT EXISTS MY_DB";
// Execute a SQL query and get a DB reader
command.ExecuteNonQuery();
// Close the connection after all operations are done
conn.Close();
Executing a SQL command that returns a result
// First you would need to create a command
var command = conn.CreateCommand();
// ... and set the SQL query
command.CommandText = "SELECT * FROM my_table";
// Execute a SQL query and get a DB reader
DbDataReader reader = command.ExecuteReader();
// Optionally you can check whether the result set has rows
Console.WriteLine($"Has rows: {reader.HasRows}");
// Discover the result metadata
int n = reader.FieldCount();
for (int i = 0; i < n; i++)
{
Type type = reader.GetFieldType();
string name = reader.GetName();
}
// Iterate over the rows and get values
while (reader.Read())
{
for (int i = 0; i < n; i++)
{
Console.WriteLine($"{reader.GetName(i)}:{reader.GetFieldType(i)}={reader.GetValue(i)}");
}
}
Executing a command with SET parameter
var tz = conn.CreateCommand();
tz.CommandText = "SET time_zone=America/New_York";
tz.ExecuteNonQuery();
tz.CommandText = "SELECT '2000-01-01 12:00:00.123456 Europe/Berlin'::timestamptz as t";
DbDataReader tzr = tz.ExecuteReader();
if (tzr.Read())
{
// 2000-01-01 06:00:00.123456-05
Console.WriteLine(tzr.GetDateTime(0));
}
Server-side Asynchronous Query Execution
Firebolt supports server-side asynchronous query execution, allowing queries to run in the background while you retrieve results later. This is particularly useful for long-running queries, as it eliminates the need to maintain a persistent connection to the server while waiting for execution to complete.
⚠ Note: This is different from .NET's asynchronous programming model. Firebolt's server-side async execution means that the query runs independently on the server, while .NET async/await handles non-blocking execution on the client side.
Execute an Asynchronous Query
Executing a query asynchronously means the database will start processing it in the background. Instead of returning data immediately, the response contains a query token, which can be used later (even in a new connection) to check the query status or retrieve results.
FireboltCommand command = (FireboltCommand)conn.CreateCommand();
command.CommandText = "INSERT INTO large_table SELECT * FROM source_table";
// Execute the query asynchronously on the server
command.ExecuteServerSideAsyncNonQuery();
// Alternatively, use .NET's async/await to avoid blocking the client thread
await command.ExecuteServerSideAsyncNonQueryAsync();
// Store the async query token for later use
string token = command.AsyncToken;
Check the Status of an Asynchronous Query
You can check if the query is still running or if it has finished executing.
IsServerSideAsyncQueryRunning(token)
returnstrue
if the query is still in progress andfalse
if it has finished.IsServerSideAsyncQuerySuccessful(token)
returns:true
if the query completed successfullyfalse
if the query failednull
if the query is still running
using FireboltConnection conn = new FireboltConnection(conn_string);
conn.Open();
// Check if the query is still running
bool isRunning = conn.IsServerSideAsyncQueryRunning(token);
// Check if the query completed successfully (returns null if it's still running)
bool? isSuccessful = conn.IsServerSideAsyncQuerySuccessful(token);
or use .NET asynchronous eqivalents
// Check if the query is still running
bool isRunning = await conn.IsServerSideAsyncQueryRunningAsync(token);
// Check if the query completed successfully (returns null if it's still running)
bool? isSuccessful = await conn.IsServerSideAsyncQuerySuccessfulAsync(token);
Cancel an Asynchronous Query
If an asynchronous query is no longer needed, you can cancel it before execution completes.
using FireboltConnection conn = new FireboltConnection(conn_string);
conn.Open();
// Cancel the async query
bool cancelled = conn.CancelServerSideAsyncQuery(token);
or do so asynchronously
bool cancelled = await conn.CancelServerSideAsyncQueryAsync(token);
This approach ensures that long-running queries do not block your application while allowing you to monitor, manage, and cancel them as needed.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net6.0
- Microsoft.AspNetCore.WebUtilities (>= 2.2.0)
- Newtonsoft.Json (>= 13.0.1)
- NodaTime (>= 3.1.6)
- Portable.BouncyCastle (>= 1.9.0)
- System.Text.Encodings.Web (>= 4.5.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.8.0 | 233 | 8/20/2025 |
1.7.1 | 8,927 | 6/26/2025 |
1.7.0 | 2,162 | 6/4/2025 |
1.6.1 | 17,782 | 4/28/2025 |
1.6.0 | 25,090 | 3/13/2025 |
1.5.0 | 33,290 | 12/19/2024 |
1.4.0 | 7,895 | 12/4/2024 |
1.3.5 | 1,130 | 11/21/2024 |
1.3.4 | 34,512 | 9/25/2024 |
1.3.3 | 125 | 9/24/2024 |
1.3.2 | 4,530 | 9/9/2024 |
1.3.1 | 3,238 | 8/12/2024 |
1.3.0 | 3,148 | 7/10/2024 |
1.2.0 | 5,230 | 6/6/2024 |
1.1.2 | 11,478 | 5/22/2024 |
1.1.1 | 128 | 5/14/2024 |
1.1.0 | 156 | 4/30/2024 |
1.0.0 | 159 | 2/5/2024 |
1.0.0-alpha | 212 | 11/3/2023 |
0.2.0 | 307 | 3/3/2023 |
0.1.0 | 321 | 1/20/2023 |
0.0.1 | 380 | 8/19/2022 |
Initial release of a Firebolt .NET sdk. Supported features
- Authentication
- SQL Query execution
- SET statement support