Schema<S>
A schema is a collection of tables. It is used to define the structure of a database.
Type Parameters
Type Parameter | Default type |
---|---|
S extends SchemaType | SchemaType |
Constructors
new Schema()
new Schema<S>(tables): Schema<S>
Parameters
Parameter | Type |
---|---|
tables | S | Table [] |
Returns
Schema
<S
>
Properties
Property | Modifier | Type |
---|---|---|
props | readonly | S |
tables | readonly | Table [] |
types | readonly | SchemaTableType <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;
}[];
}
Name | Type |
---|---|
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 ; }[] |
validate()
validate(): void
Returns
void