diff --git a/src/Common/Library.fs b/src/Common/Library.fs index 5bf343a..00d9bb2 100644 --- a/src/Common/Library.fs +++ b/src/Common/Library.fs @@ -292,3 +292,15 @@ module Query = [] let selectFromTable tableName = find tableName + + /// Create an ORDER BY clause for the given fields + [] + let orderBy fields dialect = + if Seq.isEmpty fields then "" + else + fields + |> Seq.map (fun it -> + let direction = if it.Name.Contains ' ' then $" {(it.Name.Split ' ')[1]}" else "" + it.Path dialect + direction) + |> String.concat ", " + |> function it -> $" ORDER BY {it}" diff --git a/src/Directory.Build.props b/src/Directory.Build.props index ea70aa3..e73f3da 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -3,10 +3,10 @@ net6.0;net8.0 embedded false - 3.1.0.0 - 3.1.0.0 - 3.1.0 - Add BT (between) operator; drop .NET 7 support + 4.0.0.0 + 4.0.0.0 + 4.0.0 + Change ByField to ByFields; support dot-access to document fields; add Find*Ordered functions/methods danieljsummers Bit Badger Solutions README.md