Lucid and Drive updates 9. Sept 2021

articles/adonisjs.jpeg

Lucid bugfixes

@adonisjs/[email protected] and @adonisjs/[email protected] were bugfix releases were made.

Most noticeable are two bugfixes:

  • “fix(paginator): pass rows as an iterator to the Array class” - Which essentially means you can now use .map() .forEach() etc on pagination result
const users = await User.query().paginate(request.input('page') || 1)

// .map() works directly now :) 
users.map(user => {
  console.log(user)
  // .. Do something
  return user
})

// Before you had to get .all()
users.all().map(user => {
  console.log(user)
  // .. Do something
  return user
})

Additionally now you can use with and withRecursive methods with raw queries, callbacks and sub-queries. Before v16.0.2 they were just ignored. There’s no longer need to make whole query in Database.raw()

Drive bugfixes

@adonisjs/[email protected] improved it’s logging and it now passes all default options to driver in use. Which should get rid of issues where half config went missing

It’s also reason for new version of @adonisjs/[email protected] - to update underlying Drive package

The Latest