dlt-connector
Skill này làm gì
Skill này hướng dẫn kết nối các dịch vụ SaaS với Wren Engine: cài đặt dlt, thiết lập thông tin xác thực, chạy pipeline vào DuckDB và tạo một dự án ngữ nghĩa (semantic). Skill dành cho nhà phân tích dữ liệu muốn truy vấn dữ liệu từ các công cụ kinh doanh bằng SQL.
Khi nào nên dùng
- ✓Khi bạn muốn kéo dữ liệu từ một công cụ SaaS như HubSpot, Stripe hoặc Salesforce vào cơ sở dữ liệu.
- ✓Khi bạn đã có file DuckDB và chỉ cần xây dựng dự án ngữ nghĩa trên đó.
- ✓Khi bạn muốn bắt đầu truy vấn dữ liệu SaaS bằng SQL thông qua Wren.
Liên kết skill
https://github.com/Canner/WrenAI/blob/main/core/wren/src/wren/skills_content/dlt-connector/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Hãy kết nối tài khoản Stripe của tôi với Wren, tải các giao dịch thanh toán của tháng trước vào DuckDB và thiết lập một dự án để tôi có thể truy vấn.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill đi qua bốn giai đoạn: cài đặt dlt, tải nguồn dữ liệu vào DuckDB, khảo sát lược đồ để xây dựng dự án Wren, rồi kiểm tra bằng các truy vấn SQL thực tế.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
wren-dlt-connector
Reference docs (
dlt_sources) and theintrospect_dltscript are bundled. Pull references withwren skills get dlt-connector --full; fetch a script withwren skills get dlt-connector --script <name>.
Connect SaaS data to Wren Engine for SQL analysis — from zero to a verified, queryable project in one conversation.
Who this is for
Data analysts who know SQL and some Python, but may not have used dlt or Wren before. Explain concepts briefly when they first appear, but don't over-explain things a SQL-literate person would already know.
Overview
This skill walks through a four-phase workflow:
- Extract — Use dlt (data load tool) to pull data from a SaaS API into a local DuckDB file
- Model — Introspect the DuckDB schema and auto-generate a Wren semantic project (YAML models, relationships, profile)
- Build & Verify — Build the project and run actual SQL queries to confirm everything works end-to-end
- Handoff — Show the user their data and next steps
The user might enter at any phase. Ask which phase they're starting from — they may already have a .duckdb file and just need phases 2–4.
The goal is a project that actually queries successfully, not just files that look correct. Always run the verification step before declaring success.
Critical: DuckDB catalog naming
When wren engine connects to a DuckDB file, it ATTACHes it using the filename (without .duckdb extension) as the catalog alias:
ATTACH DATABASE 'stripe_data.duckdb' AS "stripe_data" (READ_ONLY)
This means every model's table_reference.catalog must equal the DuckDB filename stem. If the file is hubspot.duckdb, the catalog is hubspot. If it's my_pipeline.duckdb, the catalog is my_pipeline.
Getting this wrong causes "table not found" errors at query time. The introspect_dlt.py script handles this automatically.
Critical: Type normalization
Column types must be normalized using wren SDK's type_mapping.parse_type() function, which uses sqlglot to convert database-specific types (like DuckDB's HUGEINT, TIMESTAMP WITH TIME ZONE) into canonical SQL types that wren-core understands. Do not hardcode type mappings — always delegate to parse_type(raw_type, "duckdb").
The introspect_dlt.py script does this automatically when wren SDK is installed.
Phase 1: Extract — dlt Pipeline Setup
Step 1: Pick the SaaS source
Ask the user which SaaS service they want to connect. Read dlt_sources for a list of popular verified sources and their auth requirements. If the source isn't listed, check whether dlt has a verified source for it by searching dlthub.com/docs/dlt-ecosystem/verified-sources.
Step 2: Install dlt
pip install "dlt[duckdb]" --break-system-packages
Step 3: Write the pipeline script
Create a Python script that:
- Imports the dlt source function for the chosen SaaS
- Configures the pipeline with
destination='duckdb'and a local file path - Runs the pipeline with
pipeline.run(source)
Here's the general pattern — adapt it per source (check dlt_sources for source-specific templates):
import dlt
pipeline = dlt.pipeline(
pipeline_name="<source>_pipeline",
destination="duckdb",
dataset_name="<source>_data",
)
# Source-specific: check the dlt_sources reference for auth patterns
source = <source_function>(api_key=dlt.secrets.value)
info = pipeline.run(source)
print(info)
Step 4: Set up credentials
dlt reads credentials from environment variables or .dlt/secrets.toml. The simplest approach for a one-time run:
# Set the credential as an environment variable
# The exact variable name depends on the source — check the dlt_sources reference
export SOURCES__<SOURCE>__API_KEY="the-actual-key"
Ask the user for their API key or token. Remind them:
- Never commit credentials to git
- Environment variables are the simplest way for a one-time run
- For repeated use, they can create
.dlt/secrets.toml
Step 5: Run the pipeline
python <pipeline_script>.py
After the run, confirm:
- The pipeline completed without errors
- A
.duckdbfile was created (usually at<pipeline_name>.duckdb) - Print discovered tables and their column counts
import duckdb
con = duckdb.connect("<pipeline_name>.duckdb", read_only=True)
for row in con.execute("""
SELECT table_schema, table_name,
(SELECT COUNT(*) FROM information_schema.columns c
Câu hỏi thường gặp
dlt là gì?
Đó là công cụ tải dữ liệu, kéo dữ liệu từ các API vào một file cơ sở dữ liệu như DuckDB.
Vì sao phải chạy truy vấn kiểm tra?
Skill nói thành công nghĩa là một dự án thật sự chạy được truy vấn, chứ không chỉ là các file trông có vẻ đúng.
Tôi có cần biết Python không?
Có chút Python sẽ hữu ích vì pipeline dùng Python, nhưng skill giải thích các bước cho người đã biết SQL.
Chi tiết
Mô tả gốc của tác giả
Connect SaaS data (HubSpot, Stripe, Salesforce, GitHub, Slack, etc.) to Wren Engine for SQL analysis. Guides the user through the full flow: install dlt, pick a SaaS source, set up credentials, run the data pipeline into DuckDB, then auto-generate a Wren semantic project from the loaded data. Use this skill whenever the user mentions: connecting SaaS data, importing data from an API, dlt pipelines, loading HubSpot/Stripe/Salesforce/GitHub/Slack data, querying SaaS data with SQL, or setting up a new data source from a REST API. Also trigger when the user already has a dlt-produced DuckDB file a
repo: Canner/WrenAI
Độ phổ biến
- Sao GitHub
- 18k
- Vị trí xếp hạng
- #10724
- Giấy phép
- —
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
enrich-context
18kGiúp agent của bạn bổ sung ý nghĩa kinh doanh cho một dự án dữ liệu Wren, như đơn vị đo, giá trị liệt kê, từ đồng nghĩa và các chỉ số chuẩn.
genbi
18kGiúp agent của bạn biến dự án Wren thành bảng điều khiển trên trình duyệt có thể chia sẻ và triển khai lên tài khoản hosting của bạn.
generate-mdl
18kGiúp agent của bạn tạo dự án ngữ nghĩa Wren bằng cách khám phá lược đồ cơ sở dữ liệu, chuẩn hóa kiểu dữ liệu và sinh các file YAML.
onboarding
18kGiúp agent của bạn thiết lập Wren Engine từ đầu: kiểm tra môi trường, tạo dự án, kết nối cơ sở dữ liệu và chạy truy vấn đầu tiên.
Skill tương tự
discrawl
394kCho phép agent của bạn tìm kiếm và tóm tắt kho lưu trữ tin nhắn Discord trên máy, kiểm tra độ mới của dữ liệu và đọc tin nhắn trực tiếp.
clickhouse-io
280kGiúp agent của bạn tối ưu truy vấn và schema trong ClickHouse theo thực hành tốt nhất cho phân tích dữ liệu hiệu năng cao khi truy vấn chậm.
scientific-db-pubmed-database
280kGiúp agent của bạn tìm bài báo khoa học trong lĩnh vực y sinh. Hữu ích cho nghiên cứu cần thông tin y khoa cụ thể.