Dobo

Dobo Database Framework for Bajo.

See ecosystem for available adapters & tools

Constructor

new Dobo()

Members

adapters :Array.<Object>

Type:
  • Array.<Object>

connections :Array.<Object>

Type:
  • Array.<Object>

features :Array.<Object>

Type:
  • Array.<Object>

getAdapter

Get adapter by name. It returns the first adapter named after "{name}"

Also support NsPath format for those who load the same named adapter but from different provider/plugin.

getAllPropertyKeys

Get all allowed property keys

getConnection

Get connection by name. It returns the first connection named after "{name}"

getFeature

Get feature by name. It returns the first adapter named after "{name}"

Also support NsPath format for those who load the same named adapter but from different provider/plugin.

getModel

Get model by name

getModelsByConnection

Get all models that bound to connection name

getPropertyKeysByType

Get allowed property keys by field type

models :Array.<Object>

Type:
  • Array.<Object>

(static, constant) aggregateTypes :Array.<string>

Type:
  • Array.<string>
Default Value
  • ['count', 'avg', 'min', 'max', 'sum']

(static, constant) histogramTypes :Array.<string>

Type:
  • Array.<string>
Default Value
  • ['daily', 'monthly', 'annually']

(static, constant) idTypes :Array.<string>

Type:
  • Array.<string>
Default Value
  • ['string', 'integer', 'smallint']

(static, constant) indexTypes :Array.<string>

Type:
  • Array.<string>
Default Value
  • ['index', 'unique', 'primary', 'fulltext']

(static, constant) propertyType :TPropertyType

Type:
  • TPropertyType

Methods

(async) init()

Initialize plugin and performing the following tasks:

  • Collecting all adapters
  • Collecting all connections
  • Collecting all features
  • Collecting all models

(async) start(connsopt, noRebuildopt)

Start plugin

Parameters:
NameTypeAttributesDefaultDescription
connsstring | Array<optional>
all

Which connections should be run on start

noRebuildboolean<optional>
true

Set false to not rebuild model on start. Yes, only set it to false if you REALLY know what you're doing!!!

(static) sanitizeDate(value, optionsopt) → {string|Date}

Sanitize value as a date/time value. Parse/format string using dayjs format

Parameters:
NameTypeAttributesDefaultDescription
valuenumber | string

Value to sanitize

optionsObject<optional>
{}

Options object

Properties
NameTypeAttributesDefaultDescription
silentboolean<optional>
true

If true (default) and value isn't valid, returns empty

inputFormatstring<optional>

If provided, parse value using this option

outputFormatstring<optional>

If not provided or native, returns Javascript Date. Otherwise returns formatted date/time string

Returns:
Type: 
string | Date