dlt-connector
できること
このスキルは、SaaSサービスをWren Engineに接続する方法を案内します。dltのインストール、認証情報の設定、DuckDBへのパイプライン実行、Wrenのセマンティックプロジェクトの作成を含みます。業務ツールのデータをSQLで照会したいデータアナリスト向けです。
使う場面
- ✓HubSpot、Stripe、Salesforceなどのサービスからデータベースにデータを取り込みたいとき。
- ✓すでにDuckDBファイルがあり、その上にセマンティックプロジェクトを作るだけでよいとき。
- ✓WrenでSaaSのデータをSQLで照会し始めたいとき。
スキルのリンク
https://github.com/Canner/WrenAI/blob/main/core/wren/src/wren/skills_content/dlt-connector/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“私のStripeアカウントをWrenに接続し、先月の支払いデータをDuckDBに読み込んで、照会できるプロジェクトを設定してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
このスキルは、4つの段階で進みます。dltのインストール、ソースのDuckDBへの読み込み、スキーマの調査によるWrenプロジェクトの構築、実際のSQLクエリによる検証です。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
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
よくある質問
dltとは何ですか?
APIからデータを取得し、DuckDBなどのデータベースファイルに格納するデータ読み込みツールです。
検証用のクエリを実行するのはなぜですか?
見た目が正しいファイルではなく、実際にクエリが動くプロジェクトができて初めて成功だからです。
Pythonを知っている必要がありますか?
パイプラインがPythonを使うため、少しわかると役立ちます。ただ、このスキルはSQLに慣れた利用者向けに手順を説明しています。
詳細
作者による元の説明
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
人気
- GitHubのスター
- 18k
- ランキング
- #10724
- ライセンス
- —
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
enrich-context
18kエージェントが、単位、列挙値、同義語、標準指標などの業務上の意味をWrenのデータプロジェクトに追加できるよう支援します。
genbi
18kエージェントが、Wrenのデータプロジェクトを共有できるブラウザーのダッシュボードにし、利用者自身のホスティングアカウントにデプロイできるよう支援します。
generate-mdl
18kエージェントが、データベースのスキーマを調べ、データ型を整え、YAMLファイルを生成して、Wrenのセマンティックプロジェクトを作成できるよう支援します。
onboarding
18kエージェントが、Wren Engineを最初から設定できるよう支援します。環境の確認、プロジェクトの作成、データベースの接続、最初のクエリの実行を行います。
似ているスキル
discrawl
394k保存済みのローカルなDiscordメッセージのアーカイブを検索して要約し、その新しさを確認し、ダイレクトメッセージを読めるようエージェントを支援します。
clickhouse-io
280kエージェントがClickHouseデータベースのクエリとスキーマを最適化できるようにします。高性能な分析処理向けのベストプラクティスを適用します。分析クエリが遅すぎるときに使います。
scientific-db-pubmed-database
280kエージェントが生物医学分野の科学論文を検索するのに役立ちます。特定の医療情報が必要な研究に便利です。