push
github
2100 of 3363 branches covered (62.44%)
282 of 757 new or added lines in 74 files covered. (37.25%)
14879 existing lines in 182 files now uncovered.25574 of 98035 relevant lines covered (26.09%)
5.17 hits per line
1 |
import { DbFieldType } from '@teable/core'; |
1✔ |
2 |
import type { Knex } from 'knex'; |
1✔ |
3 |
import { AbstractSortFunction } from '../function/sort-function.abstract'; |
1✔ |
4 |
|
1✔ |
5 |
export class SortFunctionPostgres extends AbstractSortFunction { |
1✔ |
6 |
asc(builderClient: Knex.QueryBuilder): Knex.QueryBuilder { |
1✔ |
UNCOV
7
|
const { dbFieldType } = this.field; |
× |
UNCOV
8
|
|
× |
UNCOV
9
|
builderClient.orderByRaw( |
× |
UNCOV
10
|
`${dbFieldType === DbFieldType.Json ? '??::text' : '??'} ASC NULLS FIRST`, |
× |
UNCOV
11
|
[this.columnName]
|
× |
UNCOV
12
|
); |
× |
UNCOV
13
|
return builderClient;
|
× |
UNCOV
14
|
} |
× |
15 |
|
1✔ |
16 |
desc(builderClient: Knex.QueryBuilder): Knex.QueryBuilder { |
1✔ |
UNCOV
17
|
const { dbFieldType } = this.field; |
× |
UNCOV
18
|
|
× |
UNCOV
19
|
builderClient.orderByRaw( |
× |
UNCOV
20
|
`${dbFieldType === DbFieldType.Json ? '??::text' : '??'} DESC NULLS LAST`, |
× |
UNCOV
21
|
[this.columnName]
|
× |
UNCOV
22
|
); |
× |
UNCOV
23
|
return builderClient;
|
× |
UNCOV
24
|
} |
× |
25 |
} |
1✔ |