teableio/teable

View on GitHub
apps/nestjs-backend/src/db-provider/aggregation-query/sqlite/single-value/single-value-aggregation.adapter.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { AggregationFunctionSqlite } from '../aggregation-function.sqlite';

export class SingleValueAggregationAdapter extends AggregationFunctionSqlite {
  dateRangeOfDays(): string {
    return `CAST(julianday(MAX(${this.tableColumnRef})) - julianday(MIN(${this.tableColumnRef})) as INTEGER)`;
  }

  dateRangeOfMonths(): string {
    return `MAX(${this.tableColumnRef}) || ',' || MIN(${this.tableColumnRef})`;
  }
}