DbRequest

DbRequest

Prepare a DB request object with required properties

Constructor

new DbRequest(optionsopt)

Source:
Parameters:
Name Type Attributes Description
options object <optional>
Properties
Name Type Attributes Description
pool string | DbPool <optional>
table string <optional>
query object <optional>
text string <optional>
values Array.<any> <optional>
options DbRequestOptions <optional>
callback DbRequestCallback <optional>

Members

callback :DbResultCallback

Description:
  • callback to call after finished

Source:

columns :DbTable

Description:
  • All columns for the table

Source:

config :object

Description:
  • link pool.configOptions for quick convenient access

Source:

custom :object

Description:
  • an object for custom columns

Source:

keys :Array.<string>

Description:
  • List of primary key for the table

Source:

now :int

Description:
  • timestamp when this is created, ms

Source:

op :string

Description:
  • DB operation, one of get, put, incr, update, select, ...

Source:

options :object|DbRequestOptions

Description:
  • an object with optional properties for the operation

Source:

pool :DbPool

Description:
  • DB pool reference

Source:

query :object

Description:
  • a query object

Source:

table :string

Description:
  • a DB table name

Source:

text :string

Description:
  • native DB query, SQL or etc...

Source:

values :Array.<any>

Description:
  • values to be used for SQL binding

Source:

Methods

column(name) → {DbTableColumn}

Description:
  • Return a column by name

Source:
Parameters:
Name Type Description
name string
Returns:
Type Description
DbTableColumn