Getting Started with the DataProvider Toolkit

· DataProvider Team

DataProvider is a complete toolkit for .NET data access. In this post we walk through the basics: installing the CLI tools, adding the runtime package, and generating your first type-safe query.

Installation

DataProvider ships as three dotnet CLI tools plus runtime libraries. Add a local tool manifest and install the tools you need:

dotnet new tool-manifest
dotnet tool install DataProvider --version 0.9.6-beta
dotnet tool install DataProviderMigrate --version 0.9.6-beta
dotnet tool install Lql --version 0.9.6-beta

Then add the runtime package for your database:

dotnet add package Nimblesite.DataProvider.SQLite --version 0.9.6-beta

Your First Query

Write a query in LQL, transpile it to SQL, and generate a type-safe C# extension method:

using Microsoft.Data.Sqlite;
using Nimblesite.DataProvider.Core;
using MyApp.Generated;

await using var connection = new SqliteConnection("Data Source=app.db");
await connection.OpenAsync();

var result = await connection.GetActiveOrdersAsync(status: "Active");

if (result is Result<IReadOnlyList<GetActiveOrdersRow>, SqlError>.Ok ok)
{
    foreach (var order in ok.Value)
        Console.WriteLine($"{order.Id}: {order.CustomerName}");
}

Every generated method returns Result<T, SqlError> — no exceptions, no reflection, pure ADO.NET under the hood.

Type Safety

The DataProvider CLI validates every query against your schema at build time and emits C# extension methods with fully-typed row records. Invalid queries become compilation errors.

Next Steps

.NET C#