Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency kysely to v0.27.4 #1250

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Nov 16, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
kysely 0.23.3 -> 0.27.4 age adoption passing confidence

Release Notes

kysely-org/kysely (kysely)

v0.27.4

Compare Source

Hey 👋

We've reached 100 contributors AND 1,000 pull requests since our last release! 🍾
Here's all the amazing work done since version 0.27.3...

🚀 Features

PostgreSQL 🐘 / SQLite 📘
MySQL 🐬 / MS SQL Server 🥅
PostgreSQL 🐘
MS SQL Server 🥅

🐞 Bugfixes

PostgreSQL 🐘 / MS SQL Server 🥅
PostgreSQL 🐘
MS SQL Server 🥅

📖 Documentation

📦 CICD & Tooling

⚠️ Breaking Changes

🐤 New Contributors

Full Changelog: 0.27.3...0.27.4

v0.27.3

Compare Source

v0.27.2

Compare Source

  • Add allowUnorderedMigrations option for the migrator. #​723 Awesome work by @​tracehelms ❤️
  • Fix update and insert query type issues when using Kysely<any>.
  • Improve error messages when passing a wrong column name or wrong type for a column in UpdateQueryBuilder#set and InsertQueryBuilder#values methods.

v0.27.1

Compare Source

  • Add $notNull type helper
  • Support for update of table and friends #​683
  • Support insert into "person" default values #​685
  • Support arbitrary expressions in limit and offset
  • Support insert, update and delete queries in raw SQL substitutions #​680
  • Fix node 14 regression #​824
  • Fix fn.agg regression where two type arguments were required #​829

v0.27.0

Compare Source

Breaking changes
  • selectNoFrom is removed from ExpressionBuilder due to severe typescript performance issues. selectNoFrom still exists in the Kysely instance, and in most cases, you can use that instead. See this example on how to migrate: https://kyse.link/?p=s\&i=sqAZIvTQktxgXYzHGkqX.
  • Types are once again a little bit stricter in some places. You might get type errors from code like where('first_name', '=', sql`something`). You need to explicitly give a type for the sql expressions like this sql<string>`something`
  • Deprecated functions eb.cmpr and eb.bxp have been removed. Use eb as a function instead.

v0.26.3

Compare Source

  • Type performance improvements. We got ~30% speedup in our type test suite. Results will vary.
  • Fix autocompletion issues select(eb => [autocompletion works here now]).

v0.26.2

Compare Source

  • Added support for select statements without a from clause. The function is called selectNoFrom. The function name was selected after a lot of discussion. The most natural name would just be select, but new users would find that in a list of autocompletions before selectFrom and naturally use it when trying to create a select from query. This would be especially true for people coming from knex where a select from query is started using a select call. #​605
  • Add object variants of and and or functions. Allows easy where(eb => eb.and(object)) filters. #​583
  • Add support for tuples. See some examples here. #​611
  • Add addPrimaryKeyConstraint for AlterTableBuilder. #​639 Thank you @​n7olkachev ❤️
  • Add any function to function module. #​612
  • Add between method to expression builder. #​602
  • Add lit method to expression builder. #​600
  • Add multi-column variant of orderBy. #​423 Thank you @​igalklebanov ❤️

An example of an object and call:

const persons = await db
  .selectFrom('person')
  .selectAll()
  .where((eb) => eb.and({
    first_name: 'Jennifer',
    last_name: eb.ref('first_name')
  }))
  .execute()
select * from "person"
where "first_name" = $1 and "last_name" = "first_name"

v0.26.1

Compare Source

v0.26.0

Compare Source

Expression builder improvements

We improved the expression builder based on excellent feedback from the community in this issue in addition to many discord discussions. Unfortunately this means deprecating the recently added cmpr and bxp methods, but the migration should be painless. Read more @​ #​565.

Before you could create comparisons and arbitrary binary expressions using cmpr and bxp respectively:

where((eb) => eb.or([
  eb.cmpr('first_name', '=', 'Jennifer'),
  eb.cmpr('first_name', '=', 'Sylvester'),
]))

set((eb) => ({
  age: eb.bxp('age', '+', 1)
}))

After this release, you'd do this instead:

where((eb) => eb.or([
  eb('first_name', '=', 'Jennifer'),
  eb('first_name', '=', 'Sylvester'),
]))

set((eb) => ({
  age: eb('age', '+', 1)
}))

As you can see we made the expression builder callable and it can create all kinds of binary expressions. You can still use destructuring as before since the expression builder has a new property eb that returns itself:

where(({ eb, or }) => or([
  eb('first_name', '=', 'Jennifer'),
  eb('first_name', '=', 'Sylvester'),
]))

or and and chaining

We've also added new way to create and and or expressions using chaining

where((eb) => 
  eb('first_name', '=', 'Jennifer').or('first_name', '=', 'Sylvester')
]))

The old and and or methods are still there and are not going anywhere.

JSON references

The expression builder's ref function can now be used to reference nested JSON columns' fields and array items in a type-safe way:

// Postgres syntax: "addresses"->0->'postalCode'
where(({ eb, ref }) =>
  eb(ref('addresses', '->').at(0).key('postalCode'), '=', '61710')
)

// MySQL syntax: `addresses`->'$[0].postalCode'
where(({ eb, ref }) =>
  eb(ref('addresses', '->$').at(0).key('postalCode'), '=', '61710')
)

The JSON reference builder is just our first guess of a good API. We're eager to hear your feedback. More examples and a recipe on the subject will follow shortly after this release. Read more @​ #​440.

Other changes

v0.25.0

Compare Source

Large amount of contributions from many awesome people in this one, but one definitely stands out:

Using his sorcerous knowledge of the typescript compiler internals @​schusovskoy was able to significantly reduce the possibility of the notorious Type instantiation is excessively deep and possibly infinite compiler error throughout Kysely. Check out the PR here #​483 🧙. In our typing tests, we were able to at least double the complexity of the troublesome queries without hitting slowdowns or compiler errors. In some cases the issue seems to have gone away completely.

Simply amazing work. Thank you so much @​schusovskoy ❤️

Other fixes and improvements in no particular order:

In addition to this there were small fixes from multiple awesome people including:

v0.24.2

Compare Source

  • Add mysql helper module with jsonArrayFrom and jsonObjectFrom functions. See this recipe for more info.

v0.24.1

Compare Source

v0.24.0

Compare Source

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.

v0.23.5

Compare Source

  • Force IDEs to show simple result types on hover
Screenshot 2023-03-06 at 11 39 06

Thank you @​steida for pointing me to the Simplify helper.

v0.23.4

Compare Source


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

Copy link

vercel bot commented Nov 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
kysely ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 19, 2024 7:48am

@renovate renovate bot changed the title fix(deps): update dependency kysely to v0.27.4 chore(deps): update dependency kysely to v0.27.4 Nov 16, 2024
Copy link

pkg-pr-new bot commented Nov 16, 2024

Open in Stackblitzkysely_koa_example

npm i https://pkg.pr.new/kysely-org/kysely@1250

commit: cf91adc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants