/starlake-skills:extract-schemafrom starlake-skills
Extract schema only from a JDBC database with `starlake extract-schema`: reverse-engineer tables, columns, and types from Postgres, MySQL, Oracle, DuckDB, etc. into Starlake YAML load configs (no data export)
Ships in starlake-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Connects to a JDBC database and extracts table schemas (column names, types, constraints) into Starlake YAML configuration files. This is the first step when reverse-engineering an existing database into a Starlake project.
starlake extract-schema [options]
--config <value>: Extract configuration name (references a file in metadata/extract/)--outputDir <value>: Where to output the generated YML files--tables <value>: Specific database tables to extract--connectionRef <value>: JDBC connection reference defined in application.sl.yml--all: Extract all schemas and tables to the external folder--external: Output YML files in the metadata/external/ folder--parallelism <value>: Parallelism level for extraction (default: available CPU cores)--snakecase: Apply snake_case transformation to column names--reportFormat <value>: Report output format: console, json, or htmlmetadata/extract/{name}.sl.yml)# metadata/extract/externals.sl.yml
version: 1
extract:
connectionRef: "duckdb"
jdbcSchemas:
- schema: "starbake"
tables:
- name: "*" # Extract all tables
tableTypes:
- "TABLE" # TABLE, VIEW, SYSTEM TABLE, GLOBAL TEMPORARY
The connection must be defined in application.sl.yml:
# metadata/application.sl.yml
version: 1
application:
connections:
duckdb:
type: "jdbc"
options:
url: "jdbc:duckdb:{{SL_ROOT}}/datasets/duckdb.db"
driver: "org.duckdb.DuckDBDriver"
source_postgres:
type: jdbc
options:
url: "jdbc:postgresql://{{PG_HOST}}:5432/{{PG_DB}}"
driver: "org.postgresql.Driver"
user: "{{DATABASE_USER}}"
password: "{{DATABASE_PASSWORD}}"
# metadata/extract/source_db.sl.yml
version: 1
extract:
connectionRef: "source_postgres"
jdbcSchemas:
- schema: "sales"
# Custom remarks queries (for databases like DB2)
columnRemarks: "SELECT COLUMN_NAME, COLUMN_TEXT FROM SYSCAT.COLUMNS WHERE ..."
tableRemarks: "SELECT TABLE_TEXT FROM SYSCAT.TABLES WHERE ..."
tableTypes:
- "TABLE"
- "VIEW"
tables:
- name: "*" # Or specific table name or pattern
fullExport: true # false for incremental
# Incremental configuration
partitionColumn: "id" # For parallel extraction
numPartitions: 4 # Parallelism level
timestamp: "updated_at" # For incremental tracking
# JDBC tuning
fetchSize: 1000 # JDBC fetch size
# Custom query (overrides table name)
sql: "SELECT * FROM orders WHERE region = 'EMEA'"
# Column selection (optional)
columns:
- "order_id"
- "customer_id"
- "order_date"
- "total_amount"
The command generates table YAML files like:
# Generated: metadata/load/starbake/orders.sl.yml
version: 1
table:
name: "orders"
pattern: "orders_.*.json"
attributes:
- name: "order_id"
type: "long"
required: true
- name: "customer_id"
type: "long"
- name: "status"
type: "string"
- name: "timestamp"
type: "timestamp"
starlake extract-schema --config externals --outputDir metadata/load
starlake extract-schema --connectionRef source_postgres --outputDir metadata/load
starlake extract-schema --config externals --tables starbake.orders,starbake.customers
starlake extract-schema --config externals --all --external
starlake extract-schema --config externals --outputDir metadata/load --snakecase
starlake extract-schema --config externals --outputDir metadata/load --parallelism 8
What SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (starlake-ai/starlake-skills) — no native marketplace selected
npx claudepluginhub p/starlake-ai-starlake-skills75 skills in this plugin
/acl-dependenciesVisualize access control with `starlake acl-dependencies` — graph which users and groups can access which tables, from the ACL and RLS (row-level security) definitions in your YAML, output as SVG, PNG, or JSON/autoloadInfer schemas from files in the incoming directory and load them into the warehouse in one step with `starlake autoload`. Use for quick starts or new data files with no YAML table definitions yet; generates the table configs automatically./bootstrapCreate a new Starlake project with `starlake bootstrap` — scaffold the standard metadata/load/transform directory structure and starter config from a template (quickstart, simple). Use when initializing or setting up a new project.