LINQ-native Snowflake integration for DataLinq.NET. Write C#, run Snowflake — custom methods auto-translate to UDFs at runtime. Free developer tier (1,000 rows) included.
$ dotnet add package DataLinq.SnowflakeLINQ-native Snowflake integration for DataLinq.Net.
dotnet add package DataLinq.Snowflake --version 1.1.0
IAsyncEnumerableusing DataLinq.SnowflakeQuery;
// Connect to Snowflake
using var context = Snowflake.Connect(
account: "xy12345.us-east-1",
user: "myuser",
password: "mypass",
database: "MYDB",
warehouse: "COMPUTE_WH"
);
// Query with LINQ (server-side SQL)
var orders = await context.Read.Table<Order>("orders")
.Where(o => o.Amount > 1000)
.OrderByDescending(o => o.OrderDate)
.Take(100)
.ToList();
// Client-side processing requires explicit Pull()
await context.Read.Table<Order>("orders")
.Where(o => o.Status == "Active") // Server-side SQL
.Pull() // ← Switch to client
.ForEach(o => Console.WriteLine(o)) // Client-side C#
.Do();
Snowflake uses native IAsyncEnumerable streaming - O(1) memory, no config needed:
// Bulk insert (streams via PUT + COPY INTO)
await records.WriteTable(options, "ORDERS");
await records.WriteTable(options, "ORDERS").CreateIfMissing();
await records.WriteTable(options, "ORDERS").Overwrite();
// Upsert (merge) on key
await records.MergeTable(options, "ORDERS", o => o.OrderId);
// Update specific columns only (type-safe expressions)
await records.MergeTable(options, "ORDERS", o => o.OrderId)
.UpdateOnly(o => o.Status, o => o.UpdatedAt);
Access Snowflake VARIANT columns with natural C# property syntax:
// Model with nested properties
public class Order {
public int Id { get; set; }
[Variant] // Marks column as VARIANT
public OrderData Data { get; set; }
}
// Query nested properties - translates to colon syntax
var parisOrders = await context.Read.Table<Order>("ORDERS")
.Where(o => o.Data.Customer.City == "Paris")
.ToList();
// SQL: WHERE data:customer:city = 'Paris'
📧 Contact: support@get-datalinq.net
🐛 Report Issues: github.com/improveTheWorld/DataLinq.NET/issues
Use DataLinq.Snowflake free for development and testing up to 1,000 rows per query:
| Environment | How It's Detected | Limit |
|---|---|---|
| Debugger Attached | Visual Studio, Rider, VS Code | 1,000 rows |
| ASPNETCORE_ENVIRONMENT=Development | ASP.NET apps | 1,000 rows |
| DOTNET_ENVIRONMENT=Development | Console apps | 1,000 rows |
| DATALINQ_ENVIRONMENT=Development | Explicit opt-in | 1,000 rows |
Examples:
# Option 1: Set environment variable
$env:DATALINQ_ENVIRONMENT="Development" # PowerShell
export DATALINQ_ENVIRONMENT=Development # Bash
# Option 2: Launch with debugger attached (auto-detects)
dotnet run --launch-profile "Development" # Uses launchSettings.json
# Or simply press F5 in Visual Studio/Rider
For production workloads (unlimited rows), obtain a license at:
Set your license key as an environment variable (auto-detected at runtime):
# PowerShell
$env:DATALINQ_LICENSE_KEY="your-license-key"
# Bash/Linux/macOS
export DATALINQ_LICENSE_KEY="your-license-key"
# Docker / Kubernetes
ENV DATALINQ_LICENSE_KEY=your-license-key
Security: The license key is never in source code. Set it in your deployment environment (CI/CD secrets, Azure Key Vault, AWS Secrets Manager, etc.)