import { Attribute, Table } from "./db"; import { Aggregation, BooleanModifier, Datatype, Joins, Modifier } from "./dbStructure"; import { QueryBuilder, selectQuery } from "./query"; export type primaryData = string | number | boolean | null; export type allModifierInput = primaryData | Modifier | selectQuery | Attribute | Aggregation; export type selectElements = primaryData | Attribute | Aggregation | selectQuery export type selectFromElements = Table | Joins | null; export type joinElements = Table | Joins; export type serializeReturn = [string, primaryData[]]; export type DatatypeBuild = [QueryBuilder, number]; export type attributeSettings = { unique?: boolean, autoIncrement?: boolean, default?: primaryData, notNull?: boolean primaryKey?: boolean, foreginKey?: { link: Attribute, onDelete?: onAction, onUpdate?: onAction }, check?: BooleanModifier | ((a: Attribute) => BooleanModifier) }; export type extendedAttributeSettings = { type: Datatype, unique?: boolean, autoIncrement?: boolean, default?: primaryData, notNull?: boolean primaryKey?: boolean, foreginKey?: { link: Attribute, onDelete?: onAction, onUpdate?: onAction }, check?: BooleanModifier | ((a: Attribute) => BooleanModifier) } export enum onAction { nothing, cascade, noAction, setNull, setDefault } export enum joinType { inner, left, right, full, cross } export enum dbType { mariadb, //mysql, postgres, }