wip event list

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-02-16 23:06:36 +01:00
parent a74acda707
commit 02d52d5da8
27 changed files with 1178 additions and 465 deletions

View File

@@ -1,16 +1,18 @@
export interface SqlBuilderObject {
where: Record<string, string>;
select: Record<string, string>;
groupBy: Record<string, string>;
orderBy: Record<string, string>;
from: string;
limit: number | undefined;
offset: number | undefined;
}
export function createSqlBuilder() {
const join = (obj: Record<string, string> | string[], joiner: string) =>
Object.values(obj).filter(Boolean).join(joiner);
const sb: {
where: Record<string, string>;
select: Record<string, string>;
groupBy: Record<string, string>;
orderBy: Record<string, string>;
from: string;
limit: number | undefined;
offset: number | undefined;
} = {
const sb: SqlBuilderObject = {
where: {},
from: 'openpanel.events',
select: {},