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

teableio / teable / 8419847094

25 Mar 2024 12:12PM UTC coverage: 26.087% (-53.9%) from 79.94%
8419847094

push

github

web-flow
chore: husky to v9 and upgrade more deps (#494)

2100 of 3363 branches covered (62.44%)

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✔
8
    const { type, options } = this.field;
×
9

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

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

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

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

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

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

×
32
    const optionSets = choices.map(({ name }) => name);
×
33
    builderClient.orderByRaw(`${this.generateOrderByCase(optionSets)} DESC NULLS LAST`, [
×
34
      this.columnName,
×
35
    ]);
×
36
    return builderClient;
×
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