Skip to content

Releases: kysely-org/kysely

0.19.9

09 Jul 09:30
Compare
Choose a tag to compare

Added modifyFront and modifyEnd methods

0.19.8

04 Jul 09:46
Compare
Choose a tag to compare

Fix bug where falsy default values didn't set the hasDefaultValue value to true in ColumnMetadata.

0.19.7

03 Jul 22:06
Compare
Choose a tag to compare

Fixes #108

0.19.6

28 Jun 20:22
Compare
Choose a tag to compare

Added isAutoIncrementing and hasDefaultValue to ColumnMetadata.

0.19.5

26 Jun 09:20
Compare
Choose a tag to compare

Add support for lateral joins

const query = ctx.db
  .selectFrom('person')
  .innerJoinLateral(
    (eb) =>
      eb.selectFrom('pet')
        .select('name')
        .whereRef('pet.owner_id', '=', 'person.id')
        .as('p'),
    (join) => join.on(sql`true`)
  )
  .select(['first_name', 'p.name'])
  .orderBy('first_name')

0.19.4

25 Jun 22:24
Compare
Choose a tag to compare

Fix join method issues that caused typescript to fail with Type instantiation is excessively deep and possibly infinite.ts(2589)-

0.19.3

04 Jun 07:12
Compare
Choose a tag to compare
  • Enables tree shaking for webpack
  • Disables a webpack warning about a dynamic import in FileMigrationProvider
  • Support .mjs files in migrations

0.19.2

11 May 15:26
Compare
Choose a tag to compare

Fixes #93

0.19.1

11 May 05:44
Compare
Choose a tag to compare

The addColumn method of AlterTableBuilder now takes a third callback argument just like CreateTableBuilder.addColumn.

0.19.0

11 May 04:36
Compare
Choose a tag to compare

What's new

Kysely now has absolutely no internal dependecies to anything. Not even dynamic ones. The same code runs on node, deno, browser and is compatible with all bundlers out of the box! All dependencies are passed from the outside.

Breaking changes

The dialects now take an instance of the underlying db drivers's pool (or other connection object if a pool is not available). This is how you'd create an instance of Kysely in 0.19.0:

import { Pool } from 'pg'

const db = new Kysely<Database>({
  dialect: new PostgresDialect({
    pool: new Pool({
      host: 'localhost',
      database: 'kysely_test'
    })
  })
})
import { createPool } from 'mysql2'

const db = new Kysely<Database>({
  dialect: new MysqlDialect({
    pool: createPool({
      host: 'localhost',
      database: 'kysely_test'
    })
  })
})
import Database from 'better-sqlite3'

const db = new Kysely<Database>({
  dialect: new SqliteDialect({
    database: new Database('db.sqlite')
  })
})

If you want to initialize the pool lazily when it's used for the first time, you can use a thunk:

import { Pool } from 'pg'

const db = new Kysely<Database>({
  dialect: new PostgresDialect({
    pool: async () => new Pool({
      host: 'localhost',
      database: 'kysely_test'
    })
  })
})

FileMigrationProvider

I also changed the FileMigrationProvider once again, even though I promised never to do that again 😞. This was done to get rid of all dependencies. You now need to use the class like this:

import { promises as fs } from 'fs'
import path from 'path'

new FileMigrationProvider({
  fs,
  path,
  migrationFolder: 'path/to/migrations/folder',
})

Deno and browser builds

There's no more need for the index-nodeless file and it has been removed. You can simply import kysely or the index.ts file from the dist folder. Nothing refers to node or any node library.