github kysely-org/kysely 0.17.0

latest releases: 0.27.4, 0.27.3, 0.27.2...
2 years ago

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)

Don't miss a new kysely release

NewReleases is sending notifications on new releases.