0.24.0
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 forDeleteQueryBuilder
. Thank you @anirudh1713 β€οΈ #314 - Fix #398. Thank you @igalklebanov β€οΈ #399
- Allow streaming of
update
,insert
anddelete
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.