default
Api Code Documentation / Exports / lib/db / default
lib/db.default
Table of contents
Constructors
Properties
Methods
- createTable
- deleteRefreshToken
- disconnect
- executeQuery
- getDb
- getRefreshToken
- healthCheck
- initializeConnection
- insertRefreshToken
- liveness
Constructors
constructor
• new default()
Properties
pool
• Private
pool: Knex
<any
, any
[]>
Defined in
refreshTokenColumnName
• Private
refreshTokenColumnName: string
= "refresh_token"
Defined in
userIdColumnName
• Private
userIdColumnName: string
= "user_id"
Defined in
validityColumnName
• Private
validityColumnName: string
= "valid_until"
Defined in
Methods
createTable
▸ Private
createTable(): Promise
<void
>
Returns
Promise
<void
>
Defined in
deleteRefreshToken
▸ deleteRefreshToken(refreshToken
): Promise
<void
>
Parameters
Name | Type |
---|---|
refreshToken | string |
Returns
Promise
<void
>
Defined in
disconnect
▸ disconnect(): Promise
<void
>
Returns
Promise
<void
>
Defined in
executeQuery
▸ executeQuery(query
, errorMessage?
): Promise
<void
>
Parameters
Name | Type | Default value |
---|---|---|
query | QueryBuilder <any , any > | undefined |
errorMessage | string | "Failed to execute database operation\n" |
Returns
Promise
<void
>
Defined in
getDb
▸ getDb(): Promise
<Knex
<any
, any
[]>>
Returns
Promise
<Knex
<any
, any
[]>>
Defined in
getRefreshToken
▸ getRefreshToken(refreshToken
): Promise
<undefined
| { userId
: string
; validUntil
: number
}>
Parameters
Name | Type |
---|---|
refreshToken | string |
Returns
Promise
<undefined
| { userId
: string
; validUntil
: number
}>
Defined in
healthCheck
▸ healthCheck(): Promise
<void
>
Returns
Promise
<void
>
Defined in
initializeConnection
▸ Private
initializeConnection(): Knex
<any
, any
[]>
Returns
Knex
<any
, any
[]>
Defined in
insertRefreshToken
▸ insertRefreshToken(userId
, refreshToken
, validUntil
): Promise
<void
>
Parameters
Name | Type |
---|---|
userId | string |
refreshToken | string |
validUntil | number |
Returns
Promise
<void
>
Defined in
liveness
▸ liveness(): Promise
<{ status
: number
; statusText
: string
}>
Returns
Promise
<{ status
: number
; statusText
: string
}>