Skip to main content

HotDBMySQL

hotstaq / Modules / HotDBMySQL

Class: HotDBMySQL

The MySQL database connection.

Hierarchy​

Table of contents​

Constructors​

Properties​

Methods​

Constructors​

constructor​

• new HotDBMySQL(db?, type?, schema?)

Parameters​

NameTypeDefault value
dbConnectionnull
typestring"mysql"
schemaMySQLSchemanull

Overrides​

HotDB.constructor

Defined in​

schemas/HotDBMySQL.ts:27

Properties​

connectionStatus​

• connectionStatus: ConnectionStatus

The connection status.

Inherited from​

HotDB.connectionStatus

Defined in​

HotDB.ts:30


db​

• db: Connection

The connection to the database (or the driver).

Inherited from​

HotDB.db

Defined in​

HotDB.ts:26


schema​

• schema: MySQLSchema

The db schema. This will generate a database structure and keep it maintained as needed.

Inherited from​

HotDB.schema

Defined in​

HotDB.ts:35


type​

• type: string

The database type.

Inherited from​

HotDB.type

Defined in​

HotDB.ts:22

Methods​

connect​

â–¸ connect(connectionInfo): Promise<any[]>

Connect to the database.

Parameters​

NameType
connectionInfoHotDBConnectionInterface

Returns​

Promise<any[]>

Overrides​

HotDB.connect

Defined in​

schemas/HotDBMySQL.ts:35


dbCheck​

â–¸ Protected dbCheck(): void

Checks to see if this has a database connection.

Returns​

void

Defined in​

schemas/HotDBMySQL.ts:65


disconnect​

â–¸ disconnect(): Promise<void>

Disconnect from the server.

Returns​

Promise<void>

Overrides​

HotDB.disconnect

Defined in​

schemas/HotDBMySQL.ts:306


multiQuery​

â–¸ multiQuery(queryStrings): Promise<MySQLResults[]>

Make multiple queries. Warning! This can be a security vulnerability if misused! Ideally this should only be used when making changes to tables! Additionally, this could overwhelm the server and each command sent is not guaranteed to be done in order.

Parameters​

NameType
queryStringsstring[] | { query: string ; values: any[] }[]

Returns​

Promise<MySQLResults[]>

Overrides​

HotDB.multiQuery

Defined in​

schemas/HotDBMySQL.ts:267


query​

â–¸ query(queryString, values?): Promise<MySQLResults>

The query to make.

Parameters​

NameTypeDefault value
queryStringstringundefined
valuesany[][]

Returns​

Promise<MySQLResults>

Overrides​

HotDB.query

Defined in​

schemas/HotDBMySQL.ts:218


queryOne​

â–¸ queryOne(queryString, values?): Promise<MySQLResults>

Make a single query. If there are no results, null will be in MySQLResults.results

Parameters​

NameTypeDefault value
queryStringstringundefined
valuesany[][]

Returns​

Promise<MySQLResults>

Overrides​

HotDB.queryOne

Defined in​

schemas/HotDBMySQL.ts:237


syncMigrationsTableTracker​

â–¸ syncMigrationsTableTracker(): Promise<void>

Sync the migrations table tracker. This keeps track of all database table migrations. If the "migrations" table is missing, it will be created.

Returns​

Promise<void>

Defined in​

schemas/HotDBMySQL.ts:177


tableCheck​

â–¸ tableCheck(tableName): Promise<boolean>

Checks if the table exists.

Parameters​

NameType
tableNamestring

Returns​

Promise<boolean>

Overrides​

HotDB.tableCheck

Defined in​

schemas/HotDBMySQL.ts:191