github kysely-org/kysely 0.24.0

latest releases: 0.27.4, 0.27.3, 0.27.2...
18 months ago

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.

Don't miss a new kysely release

NewReleases is sending notifications on new releases.