FireboltNetSDK 1.0.0
dotnet add package FireboltNetSDK --version 1.0.0
NuGet\Install-Package FireboltNetSDK -Version 1.0.0
<PackageReference Include="FireboltNetSDK" Version="1.0.0" />
paket add FireboltNetSDK --version 1.0.0
#r "nuget: FireboltNetSDK, 1.0.0"
// Install FireboltNetSDK as a Cake Addin
#addin nuget:?package=FireboltNetSDK&version=1.0.0
// Install FireboltNetSDK as a Cake Tool
#tool nuget:?package=FireboltNetSDK&version=1.0.0
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 --version "(1.0.0-alpha,)"
- 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 -Version 0.*
Examples
The 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}";
Creating 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 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)}");
}
}
Execute 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));
}
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. |
-
net6.0
- Microsoft.AspNetCore.Cryptography.KeyDerivation (>= 6.0.10)
- Microsoft.AspNetCore.WebUtilities (>= 2.2.0)
- Microsoft.CodeAnalysis.CSharp (>= 4.2.0)
- Newtonsoft.Json (>= 13.0.1)
- NodaTime (>= 3.1.6)
- NUnit (>= 3.13.3)
- NUnit3TestAdapter (>= 4.2.1)
- Portable.BouncyCastle (>= 1.9.0)
- SimpleCrypto.NetCore (>= 1.0.0)
- System.Data.Common (>= 4.3.0)
- System.Data.SqlClient (>= 4.8.6)
- Uno.UI (>= 4.5.14)
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.0.0 | 90 | 2/5/2024 |
1.0.0-alpha | 178 | 11/3/2023 |
0.2.0 | 227 | 3/3/2023 |
0.1.0 | 234 | 1/20/2023 |
0.0.1 | 273 | 8/19/2022 |
Initial release of a Firebolt .NET sdk. Supported features
- Authentication
- SQL Query execution
- SET statement support