0.7.0 • Published 9 days ago

kysely-ctl v0.7.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 days ago

kysely-ctl is the official command-line tool for Kysely. We strive to make it TypeScript-first, cross-platform (macOS, Linux, and Windows), and cross-runtime (Node.js, Bun, and Deno) compatible. We also aim to have feature parity with Knex.js's CLI.

Install

npm i -D kysely-ctl

Requires kysely >= 0.18.1.

Use

Configuration

Currently, a kysely.config.ts file is required, in the project root OR .config folder. Run kysely init in your terminal to create one.

import { defineConfig } from "kysely-ctl";

export default defineConfig({
  dialect, // a Kysely dialect instance OR the name of an underlying driver library (e.g. `'pg'`).
  dialectConfig, // optional. when `dialect` is the name of an underlying driver library, `dialectConfig` is the options passed to the Kysely dialect that matches that library.
  migrations: { // optional.
    migrationFolder, // optional. name of migrations folder. default is `'migrations'`.
    migrator, // optional. a `Kysely` migrator instance. default is `Kysely`'s `Migrator`.
    provider, // optional. a `Kysely` migration provider instance. default is `kysely-ctl`'s `TSFileMigrationProvider`.
  },
  plugins, // optional. `Kysely` plugins list. default is `[]`.
});

Commands

For more information run kysely -h in your terminal.

Migrate

The migrate module mirrors Knex.js CLI's module of the same name.

knex migrate:<command>

Can now be called as either:

kysely migrate:<command>

or

kysely migrate <command>

!NOTE rollback without --all flag is not supported, as Kysely doesn't keep track of "migration batches".

Acknowledgements

acro5piano who built kysely-migration-cli and inspired this project.

UnJS's amazing tools that help power this project.

Knex.js team for paving the way.

0.5.0

10 days ago

0.4.1

11 days ago

0.7.0

9 days ago

0.6.0

10 days ago

0.4.0

13 days ago

0.3.0

16 days ago

0.1.0

24 days ago

0.1.2

24 days ago

0.2.0

22 days ago

0.1.1

24 days ago

0.0.0

1 month ago