Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SQL

The SQL DB Client

Refer all the Events here: BaseDB.on

Refer all the Methods' description here: BaseDB

Example:

const Database = new Keyvify.SQL("database", config);

Hierarchy

  • EventEmitter
    • SQL

Implements

Index

Constructors

constructor

Properties

Private SequelizeDriver

SequelizeDriver: ReturnType<typeof getDriver>

Protected Optional Readonly cache

cache: BaseCache

connected

connected: boolean

Readonly deserializer

deserializer: (input: string) => any

Type declaration

    • (input: string): any
    • Parameters

      • input: string

      Returns any

Protected model

model: ModelCtor<SQLModel>

Readonly name

name: string

Protected Readonly sequelize

sequelize: Sequelize

Readonly serializer

serializer: (input: any) => string

Type declaration

    • (input: any): string
    • Parameters

      • input: any

      Returns string

Readonly type

type: string

Static defaultMaxListeners

defaultMaxListeners: number

Static Readonly errorMonitor

errorMonitor: unique symbol

This symbol shall be used to install a listener for only monitoring 'error' events. Listeners installed using this symbol are called before the regular 'error' listeners are called.

Installing a listener using this symbol does not change the behavior once an 'error' event is emitted, therefore the process will still crash if no regular 'error' listener is installed.

Methods

add

addListener

  • addListener(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

all

  • all(): Promise<Pair[]>

connect

  • connect(): Promise<void>

delete

  • delete(key: string): Promise<number>

disconnect

  • disconnect(): Promise<void>

divide

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

empty

  • empty(): void

entries

eventNames

  • eventNames(): Array<string | symbol>

exponent

get

Protected getKey

  • getKey(key: string): Promise<Pair>

getMaxListeners

  • getMaxListeners(): number

listenerCount

  • listenerCount(event: string | symbol): number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

math

modulo

multiply

off

  • off(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

on

  • on(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

once

  • once(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependListener

  • prependListener(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

pull

push

rawListeners

  • rawListeners(event: string | symbol): Function[]

removeAllListeners

  • removeAllListeners(event?: string | symbol): this

removeListener

  • removeListener(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

set

Protected setKey

  • setKey(key: string, value: any): Promise<Pair>

setMaxListeners

  • setMaxListeners(n: number): this

subtract

truncate

  • truncate(): Promise<number>

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • deprecated

    since v4.0.0

    Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Generated using TypeDoc