0.402 (21 Feb 2025)

21 February, 2025

These changes have been shipped with version 0.402 of the CLI.

⚠️

This release contains a number of minor breaking changes to our functions SDKs.

Kysely update

In Keel functions it is possible to interact directly with the database by importing useDatabase. This exposes an instance of Kysely (opens in a new tab), a powerful SQL builder for TypeScript.

This update sees a big update to the Kysely package, which includes their latest query builder API. However, this has introduced some breaking changes. Please visit their examples (opens in a new tab) or API docs (opens in a new tab) for more on what you might need to change in your function code.

Model API's orWhere deprecated

The orWhere function has been removed from our functions runtime API. This change is aligned with how we intend the Model API to mature over time. If you have been using orWhere in your functions, you may need to consider using Kysely's API while we work on an improved way to support multiple conditions in a Model API query.

Below is an example of how you might achieve this using Kysely's API.

const persons = await db
  .selectFrom('person')
  .selectAll()
  // 1. Using the `or` method on the expression builder:
  .where((eb) => eb.or([
    eb('firstName', '=', 'Jennifer'),
    eb('firstName', '=', 'Sylvester')
  ]))
  // 2. Chaining expressions using the `or` method on the created expressions:
  .where((eb) =>
    eb('lastName', '=', 'Aniston').or('lastName', '=', 'Stallone')
  )
  .execute()

For any issues or feedback, please visit the support channel on our community discord (opens in a new tab) or contact us at help@keel.so.

Thank you for using Keel!