MySQLSchema
hotstaq / Modules / MySQLSchema
Class: MySQLSchema
The MySQL schema.
Hierarchy​
↳
MySQLSchema
Table of contents​
Constructors​
Properties​
Methods​
Constructors​
constructor​
• new MySQLSchema(name
)
Parameters​
Name | Type |
---|---|
name | string |
Overrides​
Defined in​
schemas/mysql/MySQLSchema.ts:16
Properties​
name​
• name: string
The name of this schema.
Inherited from​
Defined in​
tables​
• tables: Object
The tables in this schema.
Index signature​
â–ª [name: string
]: MySQLSchemaTable
Defined in​
schemas/mysql/MySQLSchema.ts:14
Methods​
addFieldToTable​
â–¸ addFieldToTable(tableName
, field
): void
Add a field to a table.
Parameters​
Name | Type |
---|---|
tableName | string |
field | MySQLSchemaField |
Returns​
void
Defined in​
schemas/mysql/MySQLSchema.ts:34
addFieldsToTable​
â–¸ addFieldsToTable(tableName
, fields
): void
Add a field to a table.
Parameters​
Name | Type |
---|---|
tableName | string |
fields | MySQLSchemaField [] |
Returns​
void
Defined in​
schemas/mysql/MySQLSchema.ts:45
addTable​
â–¸ addTable(table
): void
Add a table to this schema.
Parameters​
Name | Type |
---|---|
table | MySQLSchemaTable |
Returns​
void
Defined in​
schemas/mysql/MySQLSchema.ts:26
generateStructure​
â–¸ generateStructure(type?
, db?
): Promise
<string
[][]>
Generate the entire db structure. If type is set to modify, you must pass a db with an active connection.
Parameters​
Name | Type | Default value |
---|---|---|
type | HotDBGenerationType | HotDBGenerationType.Create |
db | HotDBMySQL | null |
Returns​
Promise
<string
[][]>
Defined in​
schemas/mysql/MySQLSchema.ts:77
generateTableStructure​
â–¸ generateTableStructure(tableName
, type?
, db?
): Promise
<string
[]>
Generate a table's structure. If type is set to modify, you must pass a db with an active connection.
Parameters​
Name | Type | Default value |
---|---|---|
tableName | string | undefined |
type | HotDBGenerationType | HotDBGenerationType.Create |
db | HotDBMySQL | null |
Returns​
Promise
<string
[]>