generate-mdl
यह क्या करती है
यह स्किल मौजूदा डेटाबेस से Wren MDL project बनाने में मदद करती है, जिसमें schema की खोज, types की सफ़ाई और wren कमांड लाइन से YAML फ़ाइलें बनाना शामिल है। यह उन analysts के लिए है जो पहले से इस्तेमाल हो रहे डेटाबेस पर semantic layer बनाना चाहते हैं।
कब इस्तेमाल करें
- ✓जब आप जो डेटाबेस पहले से है, उसके लिए नया Wren project बनाना चाहते हों।
- ✓जब आपकी टीम डेटाबेस को OpenMetadata में पहले से सूचीबद्ध करती है और आप उसे आयात करना चाहते हों।
- ✓जब मौजूदा टेबलों और उनके संबंधों से semantic project का ढाँचा बनाना हो।
Skill का लिंक
https://github.com/Canner/WrenAI/blob/main/core/wren/src/wren/skills_content/generate-mdl/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“हमारे Postgres सेल्स डेटाबेस से Wren project बनाइए, टेबलों के संबंध अपने-आप पहचानिए और जाँचिए कि project बन जाता है।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
यह स्किल आपके एजेंट को अपने डेटाबेस टूल से schema पढ़ने, डेटा types सामान्य करने, wren CLI से project फ़ाइलें बनवाने और build की जाँच करने के लिए कहती है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Generate Wren MDL — CLI Agent Workflow
Builds an MDL project by discovering database schema and converting it into Wren's YAML project format. The agent uses whatever database tools are available in its environment for introspection; the wren CLI handles type normalization, validation, and build.
For memory and query workflows after setup, run wren skills get usage.
Prerequisites
wrenCLI installed (pip install "wrenai[<datasource>]")- A working database connection (credentials available to the agent)
- A connection profile (set up via
wren profile add) or connection info ready
Alternative — import from an OpenMetadata catalog
If the user's team already catalogs this database in OpenMetadata, import
from the catalog instead of introspecting the live database. The import
carries curated table/column descriptions, tags, owners, and foreign-key
constraints (as relationships.yml), so the join-inference work in Phase 4
is mostly done:
wren context import openmetadata --host <om_url> --token <om_token> \
--service <om_service> --database <db> --schema <schema> --dry-run
wren context import openmetadata --host <om_url> --token <om_token> \
--service <om_service> --database <db> --schema <schema>
Ask the user for the OpenMetadata URL, a read-only bot or personal access
token, and the service name as it appears in OpenMetadata. --table
(repeatable) narrows the import. Without --force the command only adds
files that do not exist and lists the collisions it left untouched; --force
regenerates from OpenMetadata and discards local edits to generated files —
confirm with the user before using it. Relationships come from foreign keys
only; review whether additional joins are needed (Phase 4), then bind a
profile and finish with Phase 5 (wren context validate → wren context build).
Phase 0 — Detect existing project
Goal: If the current directory is already inside a wren project, let the user decide how to proceed.
Check whether wren_project.yml exists in the current working directory
(or any parent up to the repository root). If found:
- Tell the user that an existing wren project was detected and show its path.
- Ask:
- Reset — wipe the existing project (
models/,views/,relationships.yml,knowledge/, and rebuildwren_project.yml) and regenerate from scratch in the same directory. - New path — keep the existing project untouched and choose a
different directory for the new project. Ask the user for the new path,
then
wren context init --path <new_path>and continue from Phase 1 using that path.
- Reset — wipe the existing project (
If no existing project is detected, proceed directly to Phase 1.
Phase 1 — Establish connection and scope
Goal: Confirm the agent can reach the database and agree on scope with the user.
Verify connectivity using whichever tool is available:
- If SQLAlchemy:
engine.connect()test - If database driver: simple query like
SELECT 1 - If wren profile exists:
wren profile debugto check config - If raw SQL via wren:
wren --sql "SELECT 1"(requires profile or connection file)
- If SQLAlchemy:
Ask the user:
- Which schema(s) or dataset(s) to include (skip if only one exists)
- Whether to include all tables or a subset
- The datasource type for wren (e.g.,
postgres(including Aurora),mysql(including Aurora),bigquery,snowflake) — needed for type normalization dialect
Phase 2 — Discover schema
Goal: Collect table names, column names, column types, and constraints.
Use whatever introspection method is available. Here are common approaches ranked by convenience:
Option A: SQLAlchemy (recommended if available)
from sqlalchemy import create_engine, inspect
engine = create_engine(connection_url)
inspector = inspect(engine)
tables = inspector.get_table_names(schema="public")
for table in tables:
columns = inspector.get_columns(table, schema="public")
# columns → [{"name": "id", "type": INTEGER(), "nullable": False, ...}]
pk = inspector.get_pk_constraint(table, schema="public")
# pk → {"constrained_columns": ["id"], "name": "orders_pkey"}
fks = inspector.get_foreign_keys(table, schema="public")
# fks → [{"constrained_columns": ["customer_id"],
# "referred_table": "customers",
# "referred_columns": ["id"]}]
Option B: Database-specific driver
- psycopg / asyncpg (Postgres): Query `informatio
अक्सर पूछे जाने वाले सवाल
MDL क्या है?
यह semantic model का प्रारूप है, जिसमें Wren सादे YAML में टेबल, कॉलम और संबंध लिखता है।
क्या यह data catalog से आयात कर सकती है?
हाँ। स्किल OpenMetadata से आयात का तरीका बताती है, जो विवरण और foreign keys project में लाता है।
क्या इसे डेटाबेस credentials चाहिए?
हाँ। schema पढ़ने के लिए आपके एजेंट के पास काम करने वाला कनेक्शन और उसके environment में credentials होने चाहिए।
जानकारी
लेखक का मूल विवरण
Generate a Wren MDL project by exploring a database with available tools (SQLAlchemy, database drivers, MCP connectors, or raw SQL). Guides agents through schema discovery, type normalization, and MDL YAML generation using the wren CLI. Use when: user wants to create or set up a new MDL, onboard a new data source, or scaffold a project from an existing database.
repo: Canner/WrenAI
लोकप्रियता
- GitHub स्टार
- 18k
- रैंकिंग में स्थान
- #10727
- लाइसेंस
- —
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
dlt-connector
18kआपके एजेंट को HubSpot या Stripe जैसे SaaS टूल का डेटा स्थानीय DuckDB फ़ाइल में लोड करने में मदद करती है, ताकि Wren SQL विश्लेषण के लिए तैयार हो।
enrich-context
18kआपके एजेंट को Wren डेटा project में व्यावसायिक अर्थ जोड़ने में मदद करती है, जैसे units, enum वैल्यू, समानार्थी शब्द और standard metrics।
genbi
18kआपके एजेंट को Wren डेटा project को ब्राउज़र का साझा करने योग्य डैशबोर्ड बनाने और उसे आपके अपने hosting खाते पर deploy करने में मदद करती है।
onboarding
18kआपके एजेंट को Wren Engine शुरू से सेट करने में मदद करती है: माहौल जाँचना, project बनाना, डेटाबेस जोड़ना और पहली क्वेरी चलाना।
मिलती-जुलती skills
discrawl
394kयह आपके एजेंट को Discord संदेशों के सेव किए गए स्थानीय आर्काइव में खोजने, उसका सारांश बनाने और उसकी ताज़गी जांचने में मदद करती है।
clickhouse-io
280kआपके एजेंट को ClickHouse databases में queries और schemas optimize करने में मदद करता है। high-performance analytical workloads के लिए best practices लागू करता है। जब analytical queries बहुत धीमी हों, तब इसका उपयोग करें।
scientific-db-pubmed-database
280kआपके एजेंट को बायोमेडिकल क्षेत्र के वैज्ञानिक लेख खोजने में मदद करता है। जिस रिसर्च में खास मेडिकल जानकारी चाहिए, उसके लिए यह काम का है।