feat: group analytics

* wip

* wip

* wip

* wip

* wip

* add buffer

* wip

* wip

* fixes

* fix

* wip

* group validation

* fix group issues

* docs: add groups
This commit is contained in:
Carl-Gerhard Lindesvärd
2026-03-20 10:46:09 +01:00
committed by GitHub
parent 88a2d876ce
commit 11e9ecac1a
99 changed files with 5944 additions and 1432 deletions

View File

@@ -66,6 +66,7 @@ export class Query<T = any> {
alias?: string;
}[] = [];
private _skipNext = false;
private _rawJoins: string[] = [];
private _fill?: {
from: string | Date;
to: string | Date;
@@ -339,6 +340,12 @@ export class Query<T = any> {
return this.joinWithType('CROSS', table, '', alias);
}
rawJoin(sql: string): this {
if (this._skipNext) return this;
this._rawJoins.push(sql);
return this;
}
private joinWithType(
type: JoinType,
table: string | Expression | Query,
@@ -426,6 +433,10 @@ export class Query<T = any> {
`${join.type} JOIN ${join.table instanceof Query ? `(${join.table.toSQL()})` : join.table instanceof Expression ? `(${join.table.toString()})` : join.table}${aliasClause}${conditionStr}`
);
});
// Add raw joins (e.g. ARRAY JOIN)
this._rawJoins.forEach((join) => {
parts.push(join);
});
}
// WHERE
@@ -604,6 +615,7 @@ export class Query<T = any> {
// Merge JOINS
this._joins = [...this._joins, ...query._joins];
this._rawJoins = [...this._rawJoins, ...query._rawJoins];
// Merge settings
this._settings = { ...this._settings, ...query._settings };