FML.Infrastructure.Query 1.0.0

FML.Infrastructure.Query

Query building infrastructure using SqlKata for PostgreSQL.

Installation

dotnet add package FML.Infrastructure.Query --source https://nuget.freakmylife.fr/v3/index.json

Components

ISqlKataQueryFactory

Factory for creating SqlKata Query objects with PostgreSQL support.

// In Program.cs
services.AddSqlKataQueryFactory(options =>
{
    options.ConnectionString = configuration.GetConnectionString("Default");
    options.DefaultTimeout = 30;
});

// In your service
public class ReportService(ISqlKataQueryFactory queryFactory)
{
    public async Task<IEnumerable<SalesReport>> GetSalesReport()
    {
        var query = queryFactory.Create("sales")
            .Select("product_id", "SUM(amount) as total")
            .GroupBy("product_id");

        // Preview the generated SQL
        var sql = queryFactory.PreviewSqlQueryString(query);

        return await query.GetAsync<SalesReport>();
    }
}

Features

  • Fluent query building with SqlKata
  • PostgreSQL compiler
  • Connection string management
  • Configurable timeout
  • SQL preview for debugging

No packages depend on FML.Infrastructure.Query.

Version Downloads Last updated
1.0.0 2 02/07/2026