Extends
Members
plugins :Array.<(string|function())>
Plugins to be bind into a Bookshelf instance.
engine :*
- Source:
- Inherited From:
Current engine accessor.
Methods
setEngine(engine)
- Source:
- Overrides:
Set Bookshelf engine.
Bind defined plugins into the engine instance.
Parameters:
Name | Type | Description |
---|---|---|
engine |
bookshelf | The Bookshelf instance. |
extendCollection(engineopt)
Extend Bookshelf collection instance.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
engine |
bookshelf |
<optional> |
The Bookshelf instance. |
buildEngine(connection)
- Source:
- Overrides:
Build an engine with given connection.
Parameters:
Name | Type | Description |
---|---|---|
connection |
Knex | The Knex connection instance. |
Returns:
The ORM engine.
- Type
- *
withConnection(connection)
- Source:
- Inherited From:
Get ORM driver with given connection.
Parameters:
Name | Type | Description |
---|---|---|
connection |
Knex | The Knex connection instance. |
Returns:
The current driver instance.
model(name, Modelopt)
- Source:
- Inherited From:
Get and/or set model.
If name and model are provided, the model is registered as name in the engine.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string | The model name. | |
Model |
database.Model |
<optional> |
The model class. |
Returns:
Model instance.
- Type
- database.Model
getModel(name)
- Source:
- Inherited From:
Get model by name.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The model name. |
Returns:
The model instance, or null if it was not found.
- Type
- database.Model | null
setModel(name, model)
- Source:
- Inherited From:
Set model with given name.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The model name. |
model |
database.Model | The model instance. |
resolveModel(name)
- Source:
- Inherited From:
Resolve model instance by name from the models path in the database resolver.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The model name. |
Returns:
A model instance.
- Type
- database.Model | null
buildModel(model)
- Source:
- Overrides:
Build model.
Parameters:
Name | Type | Description |
---|---|---|
model |
database.Model | The model instance. |
Returns:
The built model instance.
- Type
- database.Model
getFormattedModelClassName(name)
- Source:
- Inherited From:
Get formatted model class name.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The model name. |
Returns:
The formatted model name.
- Type
- string