Releases: adonisjs/lucid
Releases · adonisjs/lucid
Update `make:model` command to optionally generate migration & controller
Fix orderBy and nullable datetime columns bug
Fix for v8.4.0
- fix: typo in instructions file name 13196ac
Bug fixes and lots of improvements
Highlights
- The
paginate
method output now extendsArray
class. So it allows you to loop over the rows directly. - You can define per connection multiple seed directories.
- The
node ace invoke @adonisjs/lucid
command now prompts for setting up the right databases
Commits
- style: format source files 102ec3c
- improvement: query.select allow raw queries adf41d8
- improvement: allow factory callback to return model instance over just attributes d1603b0
- feat: add isActive property to paginator.getUrlsForRange method output 7d7d0dd
- improvement: SimplePaginator extend Array to allow iterating over rows 008ea24
- style: format source files 6e420f0
- improvement: normalize --files property values da67e56
- improvement: make relatedQuery and relatedSubQuery compatible with each other 31d25ed
- style: format source code 6017852
- fix: invoke "onQuery" when creating subQuery 184cdec
- fix: rename opaque hint property name from "type" to "__opaque_type" 71c882f
- improvement: use app.directoriesMap to pull migrations and seeds path 469cde0
- improvement: improving seeds and migrations flow 4a6acad
- refactor: change method for resolving migrations directories d818980
- fix(validator): allow passing where constraints to rules with refs (#583) 16b6882
- improvement: improving the auto setup flow 904d31e
- chore: register instructions file with adonisjs block 2fa6d90
- feat: add instructions to auto-install DBMS (#569) 16168a1
Adding support for case insensitive search in unique and exists rules
Wooah! We have got new relationship helper methods
Finally, the support for whereHas
, has
and withCount
methods has been added to model query builder. The idea is to limit the parent rows based upon the existence of relationship. Docs will cover more about the usage
- test: fix breaking tests 6175dbb
- style: fix eslint errors 963b903
- fix(migrator): getList method create schema table when missing d982261
- feat: add support for has and whereHas methods b159609
- fix: db credentials in .env file af10ecf
- style: format source files 269697a
- docs(contributing): fix link to contributing file dc62011
- feat: allow defining custom alias for the withCount query df61f1d
- feat: add support for withCount 469f193
- fix: update method handle use case where values are falsy 232f16a
- chore: integrate prettier and update source files 1fd882a
- chore: update dependencies b4a38a3
- improvement: allow dateTime columns to be optional 853822a
Added BaseSeeder and accept connection,client in model factories
Fixes to factories and seeds commands
Adding support for factories and seeds
- chore: update validator 1a6ed3b
- refactor: register seeds typings bf1e082
- refactor: bind Adonis/Lucid/Factory to ioc container 7a0c370
- chore: update dependencies 1772663
- feat: add support for seeders a213661
- feat: allow defining custom handler for generating stub ids e755e2e
- feat: add fakerjs fe0febe
- feat: implement factory model hooks and add ids stub calls d494f13
- improvement: rename to 4563a00
- improvement: improve overall factories API 7d8398c
- fix: pivot table insert attributes 934c33d
- ci: add debug log 0952dcc
- improvement: cleanup factory relationships structure 80d63d7
- chore: fix linting issues 28dae25
- feat: implement core of the factories 5c65731
- test: add test for select statement 3d50f77
- fix(commands): correct typo in migration:status description 3141153
- fix(QueryBuilder): support falsy values in between pairs (#556) 2d2e7cb
- test: await the call to refresh ff9fb2e
- feat(Model): make refresh chainable d09e3b5
- improvement(Model): make merge, fill & save chainable (#554) 7a518d8
- feat: add toObject method to model fa8ae6e
- improvement: remove max listeners limit from transaction client 1b99bb8
- fix: cast page and limit to numbers, since paginate receives input from the HTTP request bd38a5d
- fix: use deep equal diff to find dirty values 5ebbc9e
- fix: transform query aliases to lowercase, since postgresql converts them to lowercase ccc1ca4
- test: update expose port in docker test file ecfb1c6
- test: skip dialect version check for now a1e9079
- test: add tests to ensure that relationship query builder handles groupLimit properly 4e5f262
- feat: implement groupLimit for relationship preloading def372c
- chore: update dependencies 76037a6
- refactor: move relationships persistance hydration to relation class e443b20
Adding pagination hooks and bug fixes
Pagination hooks
We have added ORM hooks for pagination too.
beforePaginate
class User extends BaseModel {
@beforePaginate()
public static someMethod ([countQuery, query]) {
}
}
afterPaginate
class User extends BaseModel {
@afterPaginate()
public static someMethod (paginator) {
console.log(paginator.all())
console.log(paginator.total)
}
}
Commits
- chore: update dependencies f7bd18f
- feat: add pagination hooks 1f9b1d3
- fix: re-compute dirty properties after initiating auto update columns b309acb
- chore: update dependencies ef3cf10
- fix(serialization): pick all fields when pick property is undefined fa0a214
- improvement:
updateOrCreate
andupdateOrCreateMany
can handle concurrent updates too 5bee648 - chore: update dependencies 4754a8c
- chore: update dependencies ed90d3a