Schema<S>
A schema is a collection of tables. It is used to define the structure of a database.
Type parameters
Type parameter | Value |
---|---|
S extends SchemaType | SchemaType |
Constructors
new Schema()
new Schema<S>(tables): Schema<S>
Parameters
Parameter | Type |
---|---|
tables | S | Table <ColumnsType >[] |
Returns
Schema
<S
>
Properties
Property | Modifier | Type |
---|---|---|
props | readonly | S |
tables | readonly | Table <ColumnsType >[] |
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;
}[];
}
Member | Type |
---|---|
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