import { Attribute, DB } from "./db"; import { BooleanModifier, Modifier } from "./dbStructure"; import { Handler } from "./defaultHandler"; import { primaryData, selectElements, selectFromElements, serializeReturn } from "./types"; export class Query { sql: string; values: primaryData[]; constructor([sql, values]:serializeReturn) { this.sql = sql; this.values = values; } } export class QueryBuilder { //injekt and data list: ([boolean, primaryData])[] = []; constructor(l?: ({ inject?: boolean, data: primaryData })[]) { if (Array.isArray(l)) for (let i = 0; i < l.length; i++) { const e = l[i]; this.list.push([e.inject ? true : false, e.data]); } } addCode(text: string) { this.list.push([false, text]); } addInjection(data: primaryData) { this.list.push([true, data]); } addInjectionCommaSeperated(data: primaryData[], comma = ", ") { for (let i = 0; i < data.length; i++) { const e = data[i]; this.list.push([true, e]); if(i+1