• 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

35.71
/apps/nestjs-backend/src/db-provider/aggregation-query/postgres/aggregation-function.postgres.ts
1
import { NotImplementedException } from '@nestjs/common';
1✔
2
import { FieldType } from '@teable/core';
1✔
3
import { AbstractAggregationFunction } from '../aggregation-function.abstract';
1✔
4

1✔
5
export class AggregationFunctionPostgres extends AbstractAggregationFunction {
1✔
6
  unique(): string {
1✔
UNCOV
7
    const { type, isMultipleCellValue } = this.field;
×
UNCOV
8
    if (type !== FieldType.User || isMultipleCellValue) {
×
UNCOV
9
      return super.unique();
×
UNCOV
10
    }
×
UNCOV
11

×
UNCOV
12
    return this.knex.raw(`COUNT(DISTINCT ?? ->> 'id')`, [this.tableColumnRef]).toQuery();
×
UNCOV
13
  }
×
14

1✔
15
  percentUnique(): string {
1✔
UNCOV
16
    const { type, isMultipleCellValue } = this.field;
×
UNCOV
17
    if (type !== FieldType.User || isMultipleCellValue) {
×
UNCOV
18
      return super.percentUnique();
×
UNCOV
19
    }
×
UNCOV
20

×
UNCOV
21
    return this.knex
×
UNCOV
22
      .raw(`(COUNT(DISTINCT ?? ->> 'id') * 1.0 / COUNT(*)) * 100`, [this.tableColumnRef])
×
UNCOV
23
      .toQuery();
×
UNCOV
24
  }
×
25

1✔
26
  dateRangeOfDays(): string {
1✔
27
    throw new NotImplementedException();
×
28
  }
×
29

1✔
30
  dateRangeOfMonths(): string {
1✔
31
    throw new NotImplementedException();
×
32
  }
×
33

1✔
34
  totalAttachmentSize(): string {
1✔
35
    return this.knex
×
36
      .raw(
×
37
        `SELECT SUM(("value"::json ->> 'size')::INTEGER) AS "value" FROM ??, jsonb_array_elements(??)`,
×
38
        [this.dbTableName, this.tableColumnRef]
×
39
      )
×
40
      .toQuery();
×
41
  }
×
42
}
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