kysely-org / kysely-ctl

Command-line tool for Kysely
MIT License
46 stars 1 forks source link

Use a unique db instance to perform scripts. #47

Closed marcosrjjunior closed 1 week ago

marcosrjjunior commented 2 weeks ago

given a project where you have a db instance definition pointing to your desired dialect like usual, we would have something like:

import { defineConfig } from 'kysely-ctl'

export default defineConfig({
  db,
  migrations: {
     migrationFolder: path.join(__dirname, './src/db/migrations')
  },
})

Kysely already provides a clear and simple Migrator class that is not related to any extra configuration or dependency. Hopefully think this could make a bit easier to use like the migration-cli.

igalklebanov commented 2 weeks ago

Hey 👋

could we allow the defineConfig to accept the same db instance to perform scripts?

Yeah.

Kysely already provides a clear and simple Migrator class that is not related to any extra configuration or dependency.

How is that related?