Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

kysely-ctl

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kysely-ctl

Command-line tool for Kysely

  • 0.4.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13K
decreased by-3.09%
Maintainers
1
Weekly downloads
 
Created
Source

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

Make sure the following peer dependencies are also installed:

kysely - pretty obvious.

c12 - used to load the kysely.config.ts file in your project.

citty - used to build and run the CLI.

consola - used for output.

nypm - used to detect package manager.

pathe - used anywhere node:path module would've been used.

pkg-types - used to read package.json files.

tsx - used to import TS migration files (required only for Node.js as Bun/Deno support importing TS files out the box).

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'`).
  dialectOptions, // optional. when `dialect` is the name of an underlying driver library, `dialectOptions` 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>

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.

Keywords

FAQs

Package last updated on 14 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc