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.
.NET 9.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Options (>= 9.0.0)
- Npgsql (>= 9.0.2)
- SqlKata (>= 3.2.3)
- SqlKata.Execution (>= 3.2.3)
| Version | Downloads | Last updated |
|---|---|---|
| 1.0.0 | 2 | 02/07/2026 |