1
0
Fork 0
mirror of synced 2024-06-26 18:10:51 +12:00
budibase/packages/types/src/documents/app/table.ts

56 lines
1.1 KiB
TypeScript
Raw Normal View History

2022-05-21 08:16:29 +12:00
import { Document } from "../document"
2022-05-20 23:29:31 +12:00
import { View } from "./view"
export interface FieldSchema {
// TODO: replace with field types enum when done
type: string
externalType?: string
fieldName?: string
name: string
tableId?: string
relationshipType?: string
through?: string
foreignKey?: string
autocolumn?: boolean
subtype?: string
throughFrom?: string
throughTo?: string
formula?: string
formulaType?: string
main?: boolean
ignoreTimezones?: boolean
meta?: {
toTable: string
toKey: string
}
constraints?: {
type?: string
email?: boolean
inclusion?: string[]
length?: {
minimum?: string | number
maximum?: string | number
}
presence?: boolean
}
}
export interface TableSchema {
[key: string]: FieldSchema
}
2022-05-20 23:29:31 +12:00
export interface Table extends Document {
type?: string
views?: { [key: string]: View }
name: string
primary?: string[]
schema: TableSchema
primaryDisplay?: string
sourceId?: string
relatedFormula?: string[]
constrained?: string[]
sql?: boolean
2022-10-19 22:35:00 +13:00
indexes?: { [key: string]: any }
dataImport?: { [key: string]: any }
2022-05-20 23:29:31 +12:00
}