Skip to main content

default

Api Code Documentation / Exports / lib/db / default

lib/db.default

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new default()

Properties

pool

Private pool: Knex<any, any[]>

Defined in

src/lib/db.ts:14


refreshTokenColumnName

Private refreshTokenColumnName: string = "refresh_token"

Defined in

src/lib/db.ts:17


userIdColumnName

Private userIdColumnName: string = "user_id"

Defined in

src/lib/db.ts:16


validityColumnName

Private validityColumnName: string = "valid_until"

Defined in

src/lib/db.ts:18

Methods

createTable

Private createTable(): Promise<void>

Returns

Promise<void>

Defined in

src/lib/db.ts:151


deleteRefreshToken

deleteRefreshToken(refreshToken): Promise<void>

Parameters

NameType
refreshTokenstring

Returns

Promise<void>

Defined in

src/lib/db.ts:100


disconnect

disconnect(): Promise<void>

Returns

Promise<void>

Defined in

src/lib/db.ts:46


executeQuery

executeQuery(query, errorMessage?): Promise<void>

Parameters

NameTypeDefault value
queryQueryBuilder<any, any>undefined
errorMessagestring"Failed to execute database operation\n"

Returns

Promise<void>

Defined in

src/lib/db.ts:20


getDb

getDb(): Promise<Knex<any, any[]>>

Returns

Promise<Knex<any, any[]>>

Defined in

src/lib/db.ts:31


getRefreshToken

getRefreshToken(refreshToken): Promise<undefined | { userId: string ; validUntil: number }>

Parameters

NameType
refreshTokenstring

Returns

Promise<undefined | { userId: string ; validUntil: number }>

Defined in

src/lib/db.ts:115


healthCheck

healthCheck(): Promise<void>

Returns

Promise<void>

Defined in

src/lib/db.ts:53


initializeConnection

Private initializeConnection(): Knex<any, any[]>

Returns

Knex<any, any[]>

Defined in

src/lib/db.ts:137


insertRefreshToken

insertRefreshToken(userId, refreshToken, validUntil): Promise<void>

Parameters

NameType
userIdstring
refreshTokenstring
validUntilnumber

Returns

Promise<void>

Defined in

src/lib/db.ts:81


liveness

liveness(): Promise<{ status: number ; statusText: string }>

Returns

Promise<{ status: number ; statusText: string }>

Defined in

src/lib/db.ts:70