Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions content/docs/models/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,17 @@ export default class User extends BaseModel {
}
```

The `consume` function also receives additional arguments that can be used when parsing the database results.

```ts
consume(value: string | null, attribute: string, model: LucidRow, adapterResult: ModelObject) => any
```

- `value`: the raw value from the database
- `attribute` string name of the model attribute
- `model` model instance object
- `adapterResult` object containing the raw result of the select query from the database

### Date columns

Lucid further enhances the date and the date-time properties and converts the database driver values to an instance of [luxon.DateTime](https://moment.github.io/luxon/).
Expand Down