Skip to main content

MySQLSchemaTable

hotstaq / Modules / MySQLSchemaTable

Class: MySQLSchemaTable

The database table.

Table of contents​

Constructors​

Properties​

Methods​

Constructors​

constructor​

• new MySQLSchemaTable(name?, fields?)

Parameters​

NameTypeDefault value
namestring""
fieldsMySQLSchemaField[][]

Defined in​

schemas/mysql/MySQLSchemaTable.ts:31

Properties​

charset​

• charset: string

The table's charset to use.

Defined in​

schemas/mysql/MySQLSchemaTable.ts:29


description​

• description: string

The table's description.

Defined in​

schemas/mysql/MySQLSchemaTable.ts:17


engine​

• engine: string

The table's engine to use.

Defined in​

schemas/mysql/MySQLSchemaTable.ts:25


fields​

• fields: MySQLSchemaField[]

The fields in the table.

Defined in​

schemas/mysql/MySQLSchemaTable.ts:21


name​

• name: string

The name of the table.

Defined in​

schemas/mysql/MySQLSchemaTable.ts:13

Methods​

addField​

â–¸ addField(field): void

Add a field.

Parameters​

NameType
fieldMySQLSchemaField

Returns​

void

Defined in​

schemas/mysql/MySQLSchemaTable.ts:43


addFields​

â–¸ addFields(fields): void

Add a field.

Parameters​

NameType
fieldsMySQLSchemaField[]

Returns​

void

Defined in​

schemas/mysql/MySQLSchemaTable.ts:51


generate​

â–¸ generate(type?, db?): Promise<string[]>

Generate the db command. If type is set to modify, you must pass a db with an active connection. Since field parsing isn't completely implemented yet, not all fields will be modified correctly. Use modifiying with caution. This will skip checking for:

  • Binary columnexistingFields
  • unique
  • zero-filled
  • generated column

Parameters​

NameTypeDefault value
typeHotDBGenerationTypeHotDBGenerationType.Create
dbHotDBMySQLnull

Returns​

Promise<string[]>

Defined in​

schemas/mysql/MySQLSchemaTable.ts:70