Initial commit - Event Planner application

This commit is contained in:
mberlin
2026-03-18 14:55:56 -03:00
commit 86d779eb4d
7548 changed files with 1006324 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
/// <reference types="./over-builder.d.ts" />
import { OverNode } from '../operation-node/over-node.js';
import { QueryNode } from '../operation-node/query-node.js';
import { parseOrderBy, } from '../parser/order-by-parser.js';
import { parsePartitionBy, } from '../parser/partition-by-parser.js';
import { freeze } from '../util/object-utils.js';
export class OverBuilder {
#props;
constructor(props) {
this.#props = freeze(props);
}
orderBy(...args) {
return new OverBuilder({
overNode: OverNode.cloneWithOrderByItems(this.#props.overNode, parseOrderBy(args)),
});
}
clearOrderBy() {
return new OverBuilder({
overNode: QueryNode.cloneWithoutOrderBy(this.#props.overNode),
});
}
partitionBy(partitionBy) {
return new OverBuilder({
overNode: OverNode.cloneWithPartitionByItems(this.#props.overNode, parsePartitionBy(partitionBy)),
});
}
/**
* Simply calls the provided function passing `this` as the only argument. `$call` returns
* what the provided function returns.
*/
$call(func) {
return func(this);
}
toOperationNode() {
return this.#props.overNode;
}
}