dlt-connector
ما الذي تفعله
تُرشد هذه المهارة ربط خدمات SaaS بمحرك Wren: تثبيت dlt، وإعداد بيانات الاعتماد، وتشغيل خط البيانات إلى DuckDB، وإنشاء مشروع دلالي. وهي للمحللين الذين يريدون الاستعلام عن بيانات أدوات الأعمال باستخدام SQL.
متى تستخدمها
- ✓عندما تريد سحب بيانات من أداة SaaS مثل HubSpot أو Stripe أو Salesforce إلى قاعدة بيانات.
- ✓عندما يكون لديك ملف DuckDB بالفعل وتحتاج فقط إلى بناء المشروع الدلالي فوقه.
- ✓عندما تريد أن تبدأ الاستعلام عن بيانات SaaS بـ SQL عبر Wren.
رابط المهارة
https://github.com/Canner/WrenAI/blob/main/core/wren/src/wren/skills_content/dlt-connector/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“اربط حساب Stripe الخاص بي بـ Wren، وحمّل مدفوعات الشهر الماضي إلى DuckDB، وأعدّ مشروعًا أستطيع الاستعلام عنه.”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
تمر المهارة بأربع مراحل: تثبيت 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؟
هي أداة لتحميل البيانات تسحب البيانات من الواجهات البرمجية إلى ملف قاعدة بيانات مثل 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
- الترخيص
- —
- آخر تحديث
- 2/11/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
enrich-context
18kيساعد وكيلك على إضافة المعنى التجاري إلى مشروع بيانات Wren، مثل الوحدات وقيم التعداد والمرادفات والمقاييس القياسية.
genbi
18kيساعد وكيلك على تحويل مشروع Wren للبيانات إلى لوحة معلومات قابلة للمشاركة في المتصفح، ونشرها في حساب الاستضافة الخاص بالمستخدم.
generate-mdl
18kيساعد وكيلك على إنشاء مشروع Wren دلالي عبر استكشاف مخطط قاعدة البيانات وتوحيد الأنواع وتوليد ملفات YAML.
onboarding
18kيساعد وكيلك على إعداد محرك Wren من الصفر: فحص البيئة وإنشاء مشروع وربط قاعدة بيانات وتشغيل أول استعلام.
مهارات مشابهة
discrawl
394kيتيح لوكيلك البحث في أرشيف محلي محفوظ لرسائل Discord وتلخيصه، والتحقق من مدى حداثته، وقراءة الرسائل المباشرة.
clickhouse-io
280kيساعد وكيلك على تحسين الاستعلامات والمخططات في ClickHouse وتطبيق أفضل ممارسات التحليل عالي الأداء، ويفيد عندما تكون الاستعلامات التحليلية بطيئة.
scientific-db-pubmed-database
280kيساعد وكيلك على البحث عن المقالات العلمية في المجال الطبي الحيوي. مفيد للبحوث التي تحتاج إلى معلومات طبية محددة.