Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

@chkit/plugin-pull

Plugin to pull existing ClickHouse table schemas into local chkit schema files.

Part of the chkit monorepo. This plugin extends the chkit CLI with schema pulling from existing ClickHouse databases.

Install

bun add -d @chkit/plugin-pull

Usage

Register the plugin in your config:

// clickhouse.config.ts
import { defineConfig } from '@chkit/core'
import { pull } from '@chkit/plugin-pull'

export default defineConfig({
  schema: './src/db/schema/**/*.ts',
  outDir: './chkit',
  plugins: [
    pull({ outFile: './src/db/schema/pulled.ts' }),
  ],
  clickhouse: {
    url: process.env.CLICKHOUSE_URL ?? 'http://localhost:8123',
  },
})

Then run:

bunx chkit pull

Documentation

See the chkit documentation.

License

MIT