Skip to main content

MySQLSchema

hotstaq / Modules / MySQLSchema

Class: MySQLSchema

The MySQL schema.

Hierarchy​

Table of contents​

Constructors​

Properties​

Methods​

Constructors​

constructor​

• new MySQLSchema(name)

Parameters​

NameType
namestring

Overrides​

HotDBSchema.constructor

Defined in​

schemas/mysql/MySQLSchema.ts:16

Properties​

name​

• name: string

The name of this schema.

Inherited from​

HotDBSchema.name

Defined in​

schemas/HotDBSchema.ts:15


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​

NameType
tableNamestring
fieldMySQLSchemaField

Returns​

void

Defined in​

schemas/mysql/MySQLSchema.ts:34


addFieldsToTable​

â–¸ addFieldsToTable(tableName, fields): void

Add a field to a table.

Parameters​

NameType
tableNamestring
fieldsMySQLSchemaField[]

Returns​

void

Defined in​

schemas/mysql/MySQLSchema.ts:45


addTable​

â–¸ addTable(table): void

Add a table to this schema.

Parameters​

NameType
tableMySQLSchemaTable

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​

NameTypeDefault value
typeHotDBGenerationTypeHotDBGenerationType.Create
dbHotDBMySQLnull

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​

NameTypeDefault value
tableNamestringundefined
typeHotDBGenerationTypeHotDBGenerationType.Create
dbHotDBMySQLnull

Returns​

Promise<string[]>

Defined in​

schemas/mysql/MySQLSchema.ts:61