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 ->
if it.Name.Contains ' ' then
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)
|> Seq.map (fun (field, direction) ->
if field.Name.StartsWith "n:" then

View File

@ -6,8 +6,8 @@
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<FileVersion>4.0.0.0</FileVersion>
<VersionPrefix>4.0.0</VersionPrefix>
<VersionSuffix>rc2</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>
<VersionSuffix>rc3</VersionSuffix>
<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>
<Company>Bit Badger Solutions</Company>
<PackageReadmeFile>README.md</PackageReadmeFile>

View File

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