Releases: kysely-org/kysely
Releases · kysely-org/kysely
0.18.1
0.18.0
Breaking changes
UpdateQueryBuilder
now takes four type arguments instead of three. The second argument is new and is the table that will be updated. The third one is a union of all the tables that can be referred to.
This only affects you if you've been using explicit types.
What's new
- "update set from" queries are now possible because of the from method in
UpdateQueryBuilder
- Raw aliases are now possible when using the
as
method of a raw sql snippet.
0.17.3
0.17.2
0.17.1
0.17.0
Breaking changes
db.raw
has been replaced with the sql template tag. sql
is a free function that can be used with or without a Kysely
instance.
See the docs for detailed instructions. Here's how you'd replace the most common use cases of the old db.raw
:
import { sql } from 'kysely'
// old
db.raw('select first_name from person where id = ?', [id])
// new
sql`select first_name from person where id = ${id}`
import { sql } from 'kysely'
// old
db.raw('select ?? from person', ['first_name'])
// new
sql`select ${sql.ref('first_name')} from person`
import { sql } from 'kysely'
// old
const result = await db.raw('select first_name from person where id = ?', [id]).execute()
// new
const result = await sql`select first_name from person where id = ${id}`.execute(db)
0.16.11
0.16.10
0.16.9
- Added the getMigrations method for
Migrator
.