Lyo.Query.Postgres
3.0.0
dotnet add package Lyo.Query.Postgres --version 3.0.0
NuGet\Install-Package Lyo.Query.Postgres -Version 3.0.0
<PackageReference Include="Lyo.Query.Postgres" Version="3.0.0" />
<PackageVersion Include="Lyo.Query.Postgres" Version="3.0.0" />
<PackageReference Include="Lyo.Query.Postgres" />
paket add Lyo.Query.Postgres --version 3.0.0
#r "nuget: Lyo.Query.Postgres, 3.0.0"
#:package Lyo.Query.Postgres@3.0.0
#addin nuget:?package=Lyo.Query.Postgres&version=3.0.0
#tool nuget:?package=Lyo.Query.Postgres&version=3.0.0
Lyo.Query.Postgres
PostgreSQL adapter for Lyo.Query. AddLyoQueryPostgres() replaces IWhereClauseService with PostgresWhereClauseService, which rewrites
FuzzyMatch.Similarity calls to EF.Functions.TrigramsSimilarity so Npgsql emits SQL similarity(col, query) >= threshold.
The evaluator stays EF-agnostic: in-memory matchers and EnumerableQuery keep the CLR Jaccard implementation. SQL Fuzzy requires CREATE EXTENSION IF NOT EXISTS pg_trgm once per
database. GIN/GiST gin_trgm_ops indexes are not created by this package.
Targets net10.0. Call after AddLyoQueryServices().
Features
- SQL Fuzzy / NotFuzzy.
similarity()via NpgsqlEF.Functions.TrigramsSimilarity, with a per-condition threshold (default 0.3). - CLR fallback.
EnumerableQuery,MatchesWhereClause, andExplainMatchkeepFuzzyMatch.Similarityso they do not pull the table into memory. - Opt-in DI.
AddLyoQueryPostgres()ReplacesIWhereClauseService. Without it, Fuzzy on EF fails translation instead of silently scanning.
Examples
Register after Lyo.Query
using Lyo.Query;
using Lyo.Query.Postgres;
services.AddLocalCache(/* … */);
services.AddLyoQueryServices();
services.AddLyoQueryPostgres();
// Database (once): CREATE EXTENSION IF NOT EXISTS pg_trgm;
Fuzzy where clause
var where = WhereClauseBuilder.And()
.Fuzzy("Name", "jon", threshold: 0.4)
.Build();
var filtered = whereClauseService.ApplyWhereClause(db.People, where);
Indexes
The % operator can use a GIN/GiST gin_trgm_ops index more readily than similarity() >= n. v1 emits similarity() so mixed per-condition thresholds in one tree stay correct.
Add CREATE INDEX … USING gist (lower(name) gist_trgm_ops) on hot columns if you own the schema; this package does not.
Dependencies
Generated from ProjectReference / PackageReference (same model as docs/Lyo.ProjectGraph.html).
Lyo.Query(direct, lyo)Lyo.Query.Evaluation(direct, lyo)Microsoft.EntityFrameworkCore10.0.5(direct, microsoft)Microsoft.Extensions.DependencyInjection.Abstractions10.0.5(direct, microsoft)Npgsql.EntityFrameworkCore.PostgreSQL10.0.3(direct, third-party)Lyo.Cache(transitive, lyo)Lyo.Common.Core(transitive, lyo)Lyo.Common.Metadata(transitive, lyo)Lyo.Compression(transitive, lyo)Lyo.Encryption(transitive, lyo)Lyo.Exceptions(transitive, lyo)Lyo.Hashing(transitive, lyo)Lyo.Health(transitive, lyo)Lyo.Json(transitive, lyo)Lyo.KeyStore(transitive, lyo)Lyo.Metrics(transitive, lyo)Lyo.Parameters(transitive, lyo)Lyo.Query.Models(transitive, lyo)Lyo.Result(transitive, lyo)Lyo.Streams(transitive, lyo)BouncyCastle.Cryptography2.6.2(transitive, third-party, netstandard2.0)EasyCompressor2.1.0(transitive, third-party)Konscious.Security.Cryptography.Argon21.3.1(transitive, third-party)Microsoft.Bcl.AsyncInterfaces10.0.5(transitive, microsoft, netstandard2.0)Microsoft.Extensions.Caching.Memory10.0.5(transitive, microsoft)Microsoft.Extensions.Configuration.Binder10.0.5(transitive, microsoft)Microsoft.Extensions.DependencyInjection10.0.5(transitive, microsoft)Microsoft.Extensions.Logging.Abstractions10.0.5(transitive, microsoft)Microsoft.Extensions.Options.ConfigurationExtensions10.0.5(transitive, microsoft)System.Buffers4.6.1(transitive, microsoft, netstandard2.0)System.IO.Hashing10.0.5(transitive, microsoft, net10.0)System.Memory4.6.3(transitive, microsoft, netstandard2.0)System.Text.Encoding.CodePages10.0.5(transitive, microsoft)System.Text.Json10.0.5(transitive, microsoft, netstandard2.0)System.Threading.Tasks.Extensions4.6.3(transitive, microsoft, netstandard2.0)
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Lyo.Query (>= 3.0.0)
- Lyo.Query.Evaluation (>= 3.0.0)
- Microsoft.EntityFrameworkCore (>= 10.0.5)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.5)
- Npgsql.EntityFrameworkCore.PostgreSQL (>= 10.0.3)
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 |
|---|---|---|
| 3.0.0 | 72 | 10/23/2026 |