kysely

A type-safe typescript SQL query builder

MIT License

Downloads
1.9M
Stars
9.3K
Committers
109

Bot releases are visible (Hide)

kysely - 0.17.3

Published by koskimas over 2 years ago

kysely - 0.17.2

Published by koskimas over 2 years ago

kysely - 0.17.1

Published by koskimas over 2 years ago

kysely - 0.17.0

Published by koskimas over 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)
kysely - 0.16.11

Published by koskimas over 2 years ago

  • Added orderBy and limit methods for DeleteQueryBuilder
kysely - 0.16.10

Published by koskimas over 2 years ago

  • Fix bug #62
kysely - 0.16.9

Published by koskimas over 2 years ago

kysely - 0.16.8

Published by koskimas over 2 years ago

  • Add a RawBuilder constructor that can be easily used without a Kysely instance.
kysely - 0.16.7

Published by koskimas over 2 years ago

kysely - 0.16.6

Published by koskimas almost 3 years ago

Fix bug where RuntimeDriver was accidentally passed to dialect driver methods.

kysely - 0.16.5

Published by koskimas almost 3 years ago

Remove mostly useless PrimitiveValue type. This should improve compatibility with deno and browsers.

kysely - 0.16.4

Published by koskimas almost 3 years ago

Use string literals in dynamic imports to make esbuild happy.

kysely - 0.16.3

Published by koskimas almost 3 years ago

Add ref method to ExpressionBuilder.

kysely - 0.16.2

Published by koskimas almost 3 years ago

Make Buffer optional. Required to make certain features work in browsers and deno.

kysely - 0.16.1

Published by koskimas almost 3 years ago

Add couple of missing .js extensions to imports.

kysely - 0.16.0

Published by koskimas almost 3 years ago

  • Fix issue with esbuild class transform #49

Breaking changes

The first two arguments of FileMigrationProvider have been removed.

Sorry for making this many breaking changes so fast. The API is finding its shape and things will calm down soon. I promise 😊

kysely - 0.15.3

Published by koskimas almost 3 years ago

Add a forgotten exports to package.json file for the index-nodeless file.

kysely - 0.15.2

Published by koskimas almost 3 years ago

Added an exprimental index-nodeless entry point that doesn't export any node.js dependencies.

import {
  CompiledQuery,
  DatabaseConnection,
  DatabaseIntrospector,
  DatabaseMetadata,
  DatabaseMetadataOptions,
  DefaultQueryCompiler,
  Dialect,
  DialectAdapter,
  Driver,
  Kysely,
  MIGRATION_LOCK_TABLE,
  MIGRATION_TABLE,
  QueryCompiler,
} from 'kysely/dist/cjs/index-nodeless.js'; // <-- The .js at the end is required

Optionally you can import the ESM version from kysely/dist/esm/index-nodeless.js

kysely - 0.15.1

Published by koskimas almost 3 years ago

Fix a bug in returningAll return type when using ColumnType.

kysely - 0.15.0

Published by koskimas almost 3 years ago

  • New ColumnType and Generated interfaces for defining separate interfaces for select, insert and update operations. See the example in the readme for more info.

Breaking changes

  • The db.migrate module has been removed. You now need to create an instance of Migrator instead.
  • The new Generated interface removes the need for db.generated which has now been removed. Simply mark your db-generated columns with Generated<T> in the table interface and remove db.generated.

Before:

interface Person {
  id: number,
  first_name: string
}
await db.insertInto('person').values({
  id: db.generated,
  first_name: 'Jennifer'
})

Now:

interface PersonTable {
  id: Generated<number>,
  first_name: string
}
type Person = Selectable<PersonTable>
await db.insertInto('person').values({
  first_name: 'Jennifer'
})