LakeQL
Overview
  • Installation
Commands
  • init
  • pull
  • create-registry
  • create-endpoint
  • generate-import-config
  • list-schemas
  • list-tables
  • list-views
  • list-columns
  • add
Configuration
  • Environment Variables
  • Config File
GitHub
LakeQL
  1. CLI
  2. Commands
  3. generate-import-config

On this page

  1. Generated shape
  2. Options
    1. --source-path <path>
    2. --output <path>
    3. --force

generate-import-config

Generate an import.config.mjs from already-pulled schemas.

generate-import-config writes an import.config.mjs from the schemas already generated under your source path. This file is a bulk-pull config for the CLI. It enumerates the generated endpoints so pull --bulk can regenerate them in one run. The API server does not read it. The server discovers schemas by globbing the generated query-schema/mutation-schema files under its schema path.

pnpm lakeql-cli generate-import-config

Run this after pull has generated one or more endpoints. The file is written as import.config.mjs in the directory you run the command from. Use --output to write elsewhere, or --force to overwrite an existing file.

Generated shape #

Each generated endpoint has a config.ts that exports the authoritative sourceConfig (dataSource, adapter, catalog, schema, tableName). generate-import-config reads those values directly — it does not infer them from the directory layout. Endpoints are grouped by dataSource, catalog, and schema, with every tableName collected into tables:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/** @type {import('@lakeql/cli').BulkPullConfig} */
export default [
  {
    dataSource: "trino",
    catalog: "hive",
    schema: "tier1_open_lake",
    tables: ["itaps_v2_environments_latest"],
  },
  {
    dataSource: "fabric",
    catalog: "fabric",
    schema: "Processed_LH",
    tables: ["tier1_open_lake"],
  },
]

Each entry carries a dataSource so a multi-source project can attribute every entry to the source it came from. The adapter is not emitted — it is derivable from the dataSource (the source's config in lakeql.config.ts knows its adapter).

--source-path <path>

Base path for generated code (resolved from the command invocation directory). Files are created in schemas/generated|custom inside this path.

PropertyValue
Typestring
RequiredNo
Defaultcommand invocation directory

--output <path>

Output file path for the generated config

PropertyValue
Typestring
RequiredNo
Default"/vercel/path0/apps/docs/import.config.mjs"

--force

Overwrite existing config without confirmation

PropertyValue
Typeboolean
RequiredNo
Defaultfalse

Previous page

create-endpoint

Next page

list-schemas