Skip to content

Commit 134a58d

Browse files
committed
feat: omit .nullsfirst/.nullslast by default
BREAKING CHANGE: omit `.nullsfirst`/`.nullslast` by default
1 parent 9c99c69 commit 134a58d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/PostgrestTransformBuilder.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export default class PostgrestTransformBuilder<
6060
column: string,
6161
{
6262
ascending = true,
63-
nullsFirst = true,
63+
nullsFirst,
6464
foreignTable,
6565
}: { ascending?: boolean; nullsFirst?: boolean; foreignTable?: string } = {}
6666
): this {
@@ -69,8 +69,8 @@ export default class PostgrestTransformBuilder<
6969

7070
this.url.searchParams.set(
7171
key,
72-
`${existingOrder ? `${existingOrder},` : ''}${column}.${ascending ? 'asc' : 'desc'}.${
73-
nullsFirst ? 'nullsfirst' : 'nullslast'
72+
`${existingOrder ? `${existingOrder},` : ''}${column}.${ascending ? 'asc' : 'desc'}${
73+
nullsFirst === undefined ? '' : nullsFirst ? '.nullsfirst' : '.nullslast'
7474
}`
7575
)
7676
return this

0 commit comments

Comments
 (0)