Class Database

Hierarchy

Index

Constructor methods

Methods

Constructor methods

constructor(filename: string, callback?: (err: Error) => void): Database

Parameters

  • filename: string
  • callback?: (err: Error) => void optional

Returns

Database

constructor(filename: string, mode?: number, callback?: (err: Error) => void): Database

Parameters

  • filename: string
  • mode?: number optional
  • callback?: (err: Error) => void optional

Returns

Database

Methods

public addListener(event: string, listener: Function): EventEmitter

Parameters

  • event: string
  • listener: Function

Returns

EventEmitter

public all(sql: string, callback?: (err: Error, rows: any[]) => void): Database

Parameters

  • sql: string
  • callback?: (err: Error, rows: any[]) => void optional

Returns

Database

public all(sql: string, params?: Array<any>): Database

Parameters

  • sql: string
  • params?: Array<any> optional

Returns

Database

public close(callback?: (err: Error) => void)

Parameters

  • callback?: (err: Error) => void optional

public each(sql: string, callback?: (err: Error, row: any) => void, complete?: (err: Error, count: number) => void): Database

Parameters

  • sql: string
  • callback?: (err: Error, row: any) => void optional
  • complete?: (err: Error, count: number) => void optional

Returns

Database

public each(sql: string, params?: Array<any>): Database

Parameters

  • sql: string
  • params?: Array<any> optional

Returns

Database

public emit(event: string, args?: Array<any>): boolean

Parameters

  • event: string
  • args?: Array<any> optional

Returns

boolean

public exec(sql: string, callback?: (err: Error) => void): Database

Parameters

  • sql: string
  • callback?: (err: Error) => void optional

Returns

Database

public get(sql: string, callback?: (err: Error, row: any) => void): Database

Parameters

  • sql: string
  • callback?: (err: Error, row: any) => void optional

Returns

Database

public get(sql: string, params?: Array<any>): Database

Parameters

  • sql: string
  • params?: Array<any> optional

Returns

Database

public listeners(event: string): Array<Function>

Parameters

  • event: string

Returns

Array<Function>

public on(event: ""trace"", listener: (sql: string) => void): Database

Parameters

  • event: ""trace""
  • listener: (sql: string) => void

Returns

Database

public on(event: ""profile"", listener: (sql: string, time: number) => void): Database

Parameters

  • event: ""profile""
  • listener: (sql: string, time: number) => void

Returns

Database

public on(event: ""error"", listener: (err: Error) => void): Database

Parameters

  • event: ""error""
  • listener: (err: Error) => void

Returns

Database

public on(event: ""open"", listener: () => void): Database

Parameters

  • event: ""open""
  • listener: () => void

Returns

Database

public on(event: ""close"", listener: () => void): Database

Parameters

  • event: ""close""
  • listener: () => void

Returns

Database

public on(event: string, listener: Function): Database

Parameters

  • event: string
  • listener: Function

Returns

Database

public once(event: string, listener: Function): EventEmitter

Parameters

  • event: string
  • listener: Function

Returns

EventEmitter

public parallelize(callback?: () => void)

Parameters

  • callback?: () => void optional

public prepare(sql: string, callback?: (err: Error) => void): Statement

Parameters

  • sql: string
  • callback?: (err: Error) => void optional

Returns

Statement

public prepare(sql: string, params?: Array<any>): Statement

Parameters

  • sql: string
  • params?: Array<any> optional

Returns

Statement

public removeAllListeners(event?: string): EventEmitter

Parameters

  • event?: string optional

Returns

EventEmitter

public removeListener(event: string, listener: Function): EventEmitter

Parameters

  • event: string
  • listener: Function

Returns

EventEmitter

public run(sql: string, callback?: (err: Error) => void): Database

Parameters

  • sql: string
  • callback?: (err: Error) => void optional

Returns

Database

public run(sql: string, params?: Array<any>): Database

Parameters

  • sql: string
  • params?: Array<any> optional

Returns

Database

public serialize(callback?: () => void)

Parameters

  • callback?: () => void optional

public setMaxListeners(n: number)

Parameters

  • n: number