Skip to content

Preparing for the next release

Compare
Choose a tag to compare
@thetutlage thetutlage released this 20 Feb 15:42

Features

  • Add support for using naturalSort to sort the migration files. It will be enabled for all new projects. Not recommended for exisiting projects, since it may change the order in certain situations
  • Add wherePivotNull method to add is null constraint in the pivot table.
  • Add withAggregate to work along side withCount, but for all other aggregates like max, min, avg and so on.
  • Add support to retrieve plain Javascript objects from a Model query using the pojo method. For example
    const posts = await Post.query().pojo()
    posts[0] // plain js object
  • Add support for wrapping where clauses to its own group. It is an advanced API meant to be used by the global scopes in the future. Release blog post will cover this feature in-depth

Breaking changes

  • Removed orm property from the config/database.ts file in favor of namingStrategy. It allows defining naming strategies for the models and pagination class.
  • The queries with aggregates now returns a model instance, earlier it used to be a plain object. One can use the new pojo method to retain the old behavior

Deprecations

  • deprecate model.preload in favor of model.load. The preload method doesn't fit the behavior, since we never preload a relationship from an existing model instance. For example:
    // Not really preloading 🤷‍♂️. Its infact post loading
    await user.preload('comments') 
    
    // New API
    await user.load('comments')

Commits

  • chore: use the next tag for release 1b585b2
  • test: fix test assertion f598460
  • test: fix incorrect column type for test tables 653cfd5
  • refactor: use the latest container api c0f495a
  • feat: add preloader.load and deprecate model.preload method be4e0d2
  • feat: add withAggregate query builder method d59ed5c
  • feat: add support for custom naming strategy 5daba98
  • improvement: improve typings for the model method afdb745
  • chore: stale bot exempt issues with on hold label 6eb115f
  • feat: add support for wherePivotNull variant b623f6b
  • feat: add support to get pojo from model queries 4ef5592
  • fix: model.refresh to use the existing transaction 7a37e08
  • fix: do not double prefix the table name for many to many and has many through query 36f3717
  • fix: wrap queries with aggregates inside model instances 21181a3
  • ci: specify version for setup_remote_docker attribute 9896444
  • ci: use recent version of ecr orb 964980d
  • style: fix typescript errors 9478b46
  • test: cover edge cases a581dd7
  • ci: fix ci config to use docker d019f8f
  • feat: add support for wrapping where clauses inside its own group d1055e4
  • chore: remove unrequire dependency 0e0940b
  • style: reformat source files 2eb23e4
  • style: reformat source files ded208b
  • chore: remove npm-audit in favor of synk 4c91220
  • chore: update dependencies 6d5be45
  • fix: 🐛 SerializeAs null ManyToMany Type File (#629) 435e8ae
  • fix(instruction): add DB_CONNECTION to the instruction f756c02
  • fix: set correct key for mssql connection (#643) 336ab7f
  • chore: use synk for security audit and remove npm audit hook 17ee50b
  • feat: add option to sort migrations with naturalSort option cbf0f3c

v10.0.0...v11.0.0