Skip to content

0.24.0

Compare
Choose a tag to compare
@koskimas koskimas released this 30 Mar 04:50
· 382 commits to master since this release

So much new stuff and big improvements, I don't know where to start! πŸŽ‰. There should be no breaking changes, but with this amount of changes and new features, it's always possible we've broken something 😬. As always, please open an issue if something is broken.

Let's start with the reason some of you are here: the deprecated filter methods and the improved ExpressionBuilder:

The improved ExpressionBuilder

We've deprecated most of the where, having, on and other filter methods like whereExists, whereNotExists, orWhere, orWhereExists in favour of the new expression builder. To get an idea what the expression builder is and what it can do, you should take a look at this recipe. Here are some of the most common migrations you should do:

// Old
where(eb => eb
  .where('first_name', '=', 'Jennifer')
  .orWhere('last_name', '=', 'Aniston')
)

// New
where(({ or, cmpr }) => or([
  cmpr('first_name', '=', 'Jennifer'),
  cmpr('last_name', '=', 'Aniston')
]))
// Old
whereNotExists(eb => eb
  .selectFrom('pet')
  .select('pet.id')
  .whereRef('pet.owner_id', '=', 'person.id')
)

// New
where(({ not, exists, selectFrom }) => not(exists(
  selectFrom('pet')
    .select('pet.id')
    .whereRef('pet.owner_id', '=', 'person.id')
)))

You can fine more examples here and here.

The new website πŸŽ‰

The first version of kysely.dev is out πŸŽ‰ A huge thanks to @fhur for the initiative and for doing allmost all work on that ❀️

Now that the site is out, we'll concentrate on adding more documentation and examples there. For now, it's pretty minimal.

Other changes

  • Add compiled query and timings to error logs. Thank you @fwojciec ❀️ #355
  • Add returningAll('table') overload for DeleteQueryBuilder. Thank you @anirudh1713 ❀️ #314
  • Fix #398. Thank you @igalklebanov ❀️ #399
  • Allow streaming of update, insert and delete query results on postgres. Thank you @igalklebanov ❀️ #377
  • Add where method toCreateIndexBuilder. Thank you @igalklebanov ❀️ #371
  • Added a new module kysely/helpers/postgres for some postgres-spcific higher level helpers. Similar packages will be added for other dialects too in the future. See this recipe for the newly available helpers.
  • Simplified types (performance-wise). Small gains here and there.