
export const DataType =  {
    String: "string",
    Int: "int"
} as const;

export type DataType = typeof DataType[keyof typeof DataType];

export function translateDataType(dataType: DataType): string {
    switch (dataType) {
        case DataType.String: return "文字列"
        case DataType.Int: return "整数"
    }
}

export interface TableData {
    _id: string,
    projectId: string,
    name: string,
    columns: Column[]
}

export interface Table {
    id: string,
    name: string,
    columns: Column[]
}

export interface Column {
    name: string, //unique
    isPrimary: boolean,
    type: DataType | "foreign",
    foreignTableName?: string,
    foreignTableColumns?: string[]
}