• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

teableio / teable / 8389227144

22 Mar 2024 10:56AM UTC coverage: 26.087% (-53.9%) from 79.937%
8389227144

push

github

web-flow
refactor: move zod schema to openapi (#487)

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

Source File
Press 'n' to go to next uncovered line, 'b' for previous

26.32
/apps/nestjs-backend/src/db-provider/sort-query/sqlite/single-value/string-sort.adapter.ts
1
import { FieldType } from '@teable/core';
1✔
2
import type { Knex } from 'knex';
1✔
3
import type { SingleSelectOptionsDto } from '../../../../features/field/model/field-dto/single-select-field.dto';
1✔
4
import { SortFunctionSqlite } from '../sort-query.function';
1✔
5

1✔
6
export class StringSortAdapter extends SortFunctionSqlite {
1✔
7
  asc(builderClient: Knex.QueryBuilder): Knex.QueryBuilder {
1✔
UNCOV
8
    const { type, options } = this.field;
×
UNCOV
9

×
UNCOV
10
    if (type !== FieldType.SingleSelect) {
×
UNCOV
11
      return super.asc(builderClient);
×
UNCOV
12
    }
×
UNCOV
13

×
UNCOV
14
    const { choices } = options as SingleSelectOptionsDto;
×
UNCOV
15

×
UNCOV
16
    const optionSets = choices.map(({ name }) => name);
×
UNCOV
17
    builderClient.orderByRaw(`${this.generateOrderByCase(optionSets)} ASC NULLS FIRST`, [
×
UNCOV
18
      this.columnName,
×
UNCOV
19
    ]);
×
UNCOV
20
    return builderClient;
×
UNCOV
21
  }
×
22

1✔
23
  desc(builderClient: Knex.QueryBuilder): Knex.QueryBuilder {
1✔
UNCOV
24
    const { type, options } = this.field;
×
UNCOV
25

×
UNCOV
26
    if (type !== FieldType.SingleSelect) {
×
UNCOV
27
      return super.desc(builderClient);
×
UNCOV
28
    }
×
UNCOV
29

×
UNCOV
30
    const { choices } = options as SingleSelectOptionsDto;
×
UNCOV
31

×
UNCOV
32
    const optionSets = choices.map(({ name }) => name);
×
UNCOV
33
    builderClient.orderByRaw(`${this.generateOrderByCase(optionSets)} DESC NULLS LAST`, [
×
UNCOV
34
      this.columnName,
×
UNCOV
35
    ]);
×
UNCOV
36
    return builderClient;
×
UNCOV
37
  }
×
38
}
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc