Check out C# LINQ, or Haskell postgresql-typed.
https://learn.microsoft.com/en-us/dotnet/csharp/programming-...
https://hackage.haskell.org/package/postgresql-typed-0.6.2.4...
https://learn.microsoft.com/en-us/dotnet/csharp/programming-...
https://hackage.haskell.org/package/postgresql-typed-0.6.2.4...