Skip to main content

Schema<S>

A schema is a collection of tables. It is used to define the structure of a database.

Type parameters

Type parameterValue
S extends SchemaTypeSchemaType

Constructors

new Schema()

new Schema<S>(tables): Schema<S>

Parameters

ParameterType
tablesS | Table<ColumnsType>[]

Returns

Schema<S>

Properties

PropertyModifierType
propsreadonlyS
tablesreadonlyTable<ColumnsType>[]
typesreadonlySchemaTableType<S>

Methods

toJSON()

toJSON(): {
tables: {
columns: {
name: string;
type: undefined | ColumnType;
}[];
indexes: {
columns: {
ascending: undefined | boolean;
name: string;
type: ColumnType;
}[];
name: string;
}[];
insert_only: boolean;
local_only: boolean;
name: string;
view_name: string;
}[];
}

Returns

{
tables: {
columns: {
name: string;
type: undefined | ColumnType;
}[];
indexes: {
columns: {
ascending: undefined | boolean;
name: string;
type: ColumnType;
}[];
name: string;
}[];
insert_only: boolean;
local_only: boolean;
name: string;
view_name: string;
}[];
}
MemberType
tables{
columns: {
 `name`: `string`;
`type`: `undefined` \| [`ColumnType`](../enumerations/ColumnType.md);
\}[];

indexes: { columns: { ascending: undefined | boolean; name: string; type: ColumnType; }[]; name: string; }[]; insert_only: boolean; local_only: boolean; name: string; view_name: string; }[] |


validate()

validate(): void

Returns

void