Skip to main content

HotDB

hotstaq / Modules / HotDB

Class: HotDB<DBType, DBResultType, DBSchema>

The server-side database connection.

Type parameters​

NameType
DBTypeany
DBResultTypeany
DBSchemaHotDBSchema

Hierarchy​

Table of contents​

Constructors​

Properties​

Methods​

Constructors​

constructor​

• new HotDB<DBType, DBResultType, DBSchema>(db?, type?, schema?)

Type parameters​

NameType
DBTypeany
DBResultTypeany
DBSchemaHotDBSchema

Parameters​

NameTypeDefault value
dbDBTypenull
typestring""
schemaDBSchemanull

Defined in​

HotDB.ts:37

Properties​

connectionStatus​

• connectionStatus: ConnectionStatus

The connection status.

Defined in​

HotDB.ts:30


db​

• db: DBType

The connection to the database (or the driver).

Defined in​

HotDB.ts:26


schema​

• schema: DBSchema

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

Defined in​

HotDB.ts:35


type​

• type: string

The database type.

Defined in​

HotDB.ts:22

Methods​

connect​

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

Connect to the database. This will only start connecting if db is null.

Parameters​

NameType
connectionInfoHotDBConnectionInterface

Returns​

Promise<any[]>

Defined in​

HotDB.ts:49


disconnect​

â–¸ Abstract disconnect(): Promise<void>

Disconnect from the server.

Returns​

Promise<void>

Defined in​

HotDB.ts:78


multiQuery​

â–¸ Optional Abstract multiQuery(queryStrings): Promise<DBResultType[]>

Make multiple queries.

Parameters​

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

Returns​

Promise<DBResultType[]>

Defined in​

HotDB.ts:74


query​

â–¸ Optional Abstract query(queryString, values?): Promise<DBResultType>

The query to make.

Parameters​

NameType
queryStringstring
values?any[]

Returns​

Promise<DBResultType>

Defined in​

HotDB.ts:66


queryOne​

â–¸ Optional Abstract queryOne(queryString, values?): Promise<DBResultType>

Make a single query.

Parameters​

NameType
queryStringstring
values?any[]

Returns​

Promise<DBResultType>

Defined in​

HotDB.ts:70


tableCheck​

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

Checks if the table exists.

Parameters​

NameType
tableNamestring

Returns​

Promise<boolean>

Defined in​

HotDB.ts:62