Preserve additional ORDER BY qualifiers

- Bump version to v4-rc3
This commit is contained in:
Daniel J. Summers 2024-08-22 20:26:37 -04:00
parent b019548a4e
commit 3bc662c984
4 changed files with 11 additions and 11 deletions

View File

@ -398,7 +398,7 @@ module Query =
|> Seq.map (fun it -> |> Seq.map (fun it ->
if it.Name.Contains ' ' then if it.Name.Contains ' ' then
let parts = it.Name.Split ' ' let parts = it.Name.Split ' '
{ it with Name = parts[0] }, Some $" {parts[1]}" { it with Name = parts[0] }, Some $""" {parts |> Array.skip 1 |> String.concat " "}"""
else it, None) else it, None)
|> Seq.map (fun (field, direction) -> |> Seq.map (fun (field, direction) ->
if field.Name.StartsWith "n:" then if field.Name.StartsWith "n:" then

View File

@ -6,8 +6,8 @@
<AssemblyVersion>4.0.0.0</AssemblyVersion> <AssemblyVersion>4.0.0.0</AssemblyVersion>
<FileVersion>4.0.0.0</FileVersion> <FileVersion>4.0.0.0</FileVersion>
<VersionPrefix>4.0.0</VersionPrefix> <VersionPrefix>4.0.0</VersionPrefix>
<VersionSuffix>rc2</VersionSuffix> <VersionSuffix>rc3</VersionSuffix>
<PackageReleaseNotes>From rc1: add case-insensitive ordering. From v3.1: Change ByField to ByFields; support dot-access to nested document fields; add Find*Ordered functions/methods; see project site for breaking changes and compatibility</PackageReleaseNotes> <PackageReleaseNotes>From rc2: preserve additional ORDER BY qualifiers. From rc1: add case-insensitive ordering. From v3.1: Change ByField to ByFields; support dot-access to nested document fields; add Find*Ordered functions/methods; see project site for breaking changes and compatibility</PackageReleaseNotes>
<Authors>danieljsummers</Authors> <Authors>danieljsummers</Authors>
<Company>Bit Badger Solutions</Company> <Company>Bit Badger Solutions</Company>
<PackageReadmeFile>README.md</PackageReadmeFile> <PackageReadmeFile>README.md</PackageReadmeFile>

View File

@ -616,14 +616,14 @@ public static class CommonCSharpTests
}), }),
TestCase("succeeds for PostgreSQL case-insensitive ordering", () => TestCase("succeeds for PostgreSQL case-insensitive ordering", () =>
{ {
Expect.equal(Query.OrderBy([Field.Named("i:Test.Field DESC")], Dialect.PostgreSQL), Expect.equal(Query.OrderBy([Field.Named("i:Test.Field DESC NULLS FIRST")], Dialect.PostgreSQL),
" ORDER BY LOWER(data#>>'{Test,Field}') DESC", " ORDER BY LOWER(data#>>'{Test,Field}') DESC NULLS FIRST",
"Order By not constructed correctly for case-insensitive field"); "Order By not constructed correctly for case-insensitive field");
}), }),
TestCase("succeeds for SQLite case-insensitive ordering", () => TestCase("succeeds for SQLite case-insensitive ordering", () =>
{ {
Expect.equal(Query.OrderBy([Field.Named("i:Test.Field ASC")], Dialect.SQLite), Expect.equal(Query.OrderBy([Field.Named("i:Test.Field ASC NULLS LAST")], Dialect.SQLite),
" ORDER BY data->>'Test'->>'Field' COLLATE NOCASE ASC", " ORDER BY data->>'Test'->>'Field' COLLATE NOCASE ASC NULLS LAST",
"Order By not constructed correctly for case-insensitive field"); "Order By not constructed correctly for case-insensitive field");
}) })
]) ])

View File

@ -452,14 +452,14 @@ let queryTests = testList "Query" [
} }
test "succeeds for PostgreSQL case-insensitive ordering" { test "succeeds for PostgreSQL case-insensitive ordering" {
Expect.equal Expect.equal
(Query.orderBy [ Field.Named "i:Test.Field DESC" ] PostgreSQL) (Query.orderBy [ Field.Named "i:Test.Field DESC NULLS FIRST" ] PostgreSQL)
" ORDER BY LOWER(data#>>'{Test,Field}') DESC" " ORDER BY LOWER(data#>>'{Test,Field}') DESC NULLS FIRST"
"Order By not constructed correctly for case-insensitive field" "Order By not constructed correctly for case-insensitive field"
} }
test "succeeds for SQLite case-insensitive ordering" { test "succeeds for SQLite case-insensitive ordering" {
Expect.equal Expect.equal
(Query.orderBy [ Field.Named "i:Test.Field ASC" ] SQLite) (Query.orderBy [ Field.Named "i:Test.Field ASC NULLS LAST" ] SQLite)
" ORDER BY data->>'Test'->>'Field' COLLATE NOCASE ASC" " ORDER BY data->>'Test'->>'Field' COLLATE NOCASE ASC NULLS LAST"
"Order By not constructed correctly for case-insensitive field" "Order By not constructed correctly for case-insensitive field"
} }
] ]