[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EEW3G6VGS1K3KP2NJCH0JN":3,"skill-same:01M6EEW3G6VGS1K3KP2NJCH0JN":45},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":20,"frontMatter":21,"refName":22,"commitSha":23,"skillDirectory":24,"forksCount":25,"repositoryHtmlUrl":26,"repositoryHomepageUrl":27,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":29,"updatedAt":30,"install":31,"resources":44},"01M6EEW3G6VGS1K3KP2NJCH0JN","duckdb",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Fduckdb\u002FSKILL.md",[],[5],"2026-11-10 10:12:30",false,"# DuckDB\n\nDuckDB is an embeddable SQL OLAP database. Think of it as SQLite for analytics — it runs in your process, needs no server, and is optimized for scanning and aggregating large datasets. It reads Parquet, CSV, and JSON files natively, which means you can query your data lake files with SQL without any import step.\n\nThis skill covers the CLI for ad-hoc exploration, the Python API for data science workflows, the Node.js API for application integration, and Parquet as the preferred storage format.\n\n## CLI\n\nInstall DuckDB as a standalone binary. On macOS and Linux, a single download gives you a full-featured SQL shell.\n\n```bash\n# install — DuckDB CLI via Homebrew (macOS\u002FLinux)\nbrew install duckdb\n```\n\n```bash\n# install — DuckDB CLI via direct download (Linux x64)\nwget https:\u002F\u002Fgithub.com\u002Fduckdb\u002Fduckdb\u002Freleases\u002Flatest\u002Fdownload\u002Fduckdb_cli-linux-amd64.zip\nunzip duckdb_cli-linux-amd64.zip\nchmod +x duckdb\nsudo mv duckdb \u002Fusr\u002Flocal\u002Fbin\u002F\n```\n\nLaunch the shell and start querying files directly:\n\n```bash\n# CLI — query a CSV file without creating a table\nduckdb -c \"SELECT country, count(*) AS orders\n            FROM 'orders.csv'\n            GROUP BY country\n            ORDER BY orders DESC\n            LIMIT 10\"\n```\n\nThe CLI can also persist data to a file-based database:\n\n```bash\n# CLI — create a persistent database and import data\nduckdb analytics.db \u003C\u003C'SQL'\nCREATE TABLE events AS SELECT * FROM 'raw_events.parquet';\nSELECT event_name, count(*) FROM events GROUP BY event_name;\nSQL\n```\n\n## Querying Files Directly\n\nDuckDB's most powerful feature is its ability to query files in place. No CREATE TABLE, no COPY, no ETL — just point SQL at a file path or glob pattern.\n\n```sql\n-- query — scan all Parquet files in a directory\nSELECT\n    date_trunc('month', created_at) AS month,\n    count(*) AS events\nFROM 'data\u002Fevents\u002F*.parquet'\nGROUP BY month\nORDER BY month;\n```\n\n```sql\n-- query — join a CSV with a Parquet file\nSELECT\n    u.email,\n    count(e.event_id) AS event_count\nFROM 'users.csv' u\nJOIN 'events.parquet' e ON u.id = e.user_id\nGROUP BY u.email\nORDER BY event_count DESC\nLIMIT 20;\n```\n\n```sql\n-- query — read JSON lines (newline-delimited JSON)\nSELECT * FROM read_json_auto('logs.jsonl') LIMIT 5;\n```\n\n## Python API\n\nDuckDB's Python package integrates tightly with pandas and the broader PyData ecosystem. Install it with pip and start querying DataFrames with SQL.\n\n```python\n# duckdb_analysis.py — Python API for analytical queries\n# pip install duckdb pandas\n\nimport duckdb\nimport pandas as pd\n\n# DuckDB can query pandas DataFrames directly\ndf = pd.DataFrame({\n    'user_id': [1, 2, 3, 1, 2, 1],\n    'event': ['view', 'view', 'signup', 'click', 'click', 'view'],\n    'ts': pd.date_range('2025-01-01', periods=6, freq='h')\n})\n\n# Query the DataFrame with SQL — no import needed\nresult = duckdb.sql(\"\"\"\n    SELECT event, count(*) AS total, count(DISTINCT user_id) AS users\n    FROM df\n    GROUP BY event\n    ORDER BY total DESC\n\"\"\").fetchdf()\n\nprint(result)\n```\n\nFor persistent databases with the Python API:\n\n```python\n# duckdb_persistent.py — persistent database with Python\n# pip install duckdb\n\nimport duckdb\n\n# Open or create a database file\ncon = duckdb.connect('analytics.db')\n\n# Create a table from a Parquet file\ncon.execute(\"\"\"\n    CREATE TABLE IF NOT EXISTS events AS\n    SELECT * FROM 'raw_events.parquet'\n\"\"\")\n\n# Run aggregation\ndaily_stats = con.execute(\"\"\"\n    SELECT\n        date_trunc('day', created_at) AS day,\n        count(DISTINCT user_id) AS dau,\n        count(*) AS total_events\n    FROM events\n    WHERE created_at >= current_date - INTERVAL '30 days'\n    GROUP BY day\n    ORDER BY day\n\"\"\").fetchdf()\n\nprint(daily_stats)\ncon.close()\n```\n\n## Node.js API\n\nThe `duckdb` npm package provides async bindings for embedding DuckDB in Node.js applications.\n\n```javascript\n\u002F\u002F duckdb-query.js — Node.js DuckDB client for analytical queries\n\u002F\u002F npm install duckdb\n\nimport duckdb from 'duckdb';\n\nconst db = new duckdb.Database(':memory:');\nconst conn = db.connect();\n\n\u002F\u002F Load a Parquet file into a table\nconn.run(`CREATE TABLE events AS SELECT * FROM 'events.parquet'`);\n\n\u002F\u002F Query with aggregation\nconn.all(`\n  SELECT\n    event_name,\n    count(*) AS total,\n    count(DISTINCT user_id) AS unique_users\n  FROM events\n  GROUP BY event_name\n  ORDER BY total DESC\n`, (err, rows) => {\n  if (err) throw err;\n  console.table(rows);\n  db.close();\n});\n```\n\nFor a promise-based workflow with the newer `duckdb-async` wrapper:\n\n```javascript\n\u002F\u002F duckdb-async-example.js — promise-based DuckDB queries in Node.js\n\u002F\u002F npm install duckdb-async\n\nimport { Database } from 'duckdb-async';\n\nasync function analyze() {\n  const db = await Database.create(':memory:');\n\n  \u002F\u002F Query CSV directly\n  const topPages = await db.all(`\n    SELECT page, count(*) AS views\n    FROM 'pageviews.csv'\n    GROUP BY page\n    ORDER BY views DESC\n    LIMIT 10\n  `);\n\n  console.table(topPages);\n  await db.close();\n}\n\nanalyze();\n```\n\n## Parquet Integration\n\nParquet is a columnar file format that pairs naturally with DuckDB. It compresses well, preserves types, and enables predicate pushdown so DuckDB can skip irrelevant row groups without reading entire files.\n\n### Writing Parquet\n\n```sql\n-- export — write query results to a Parquet file\nCOPY (\n    SELECT user_id, event_name, created_at\n    FROM 'raw_events.csv'\n    WHERE created_at >= '2025-01-01'\n) TO 'filtered_events.parquet' (FORMAT PARQUET, COMPRESSION ZSTD);\n```\n\n### Partitioned Parquet\n\nFor large datasets, partition your Parquet output by a key column to enable partition pruning:\n\n```sql\n-- export — write partitioned Parquet files by month\nCOPY (\n    SELECT *, date_trunc('month', created_at) AS month\n    FROM events\n) TO 'data\u002Fevents' (FORMAT PARQUET, PARTITION_BY (month), COMPRESSION ZSTD);\n```\n\nThis creates a directory structure like `data\u002Fevents\u002Fmonth=2025-01\u002Fdata_0.parquet` that DuckDB can scan with automatic partition filtering.\n\n### Inspecting Parquet Metadata\n\n```sql\n-- metadata — inspect Parquet file schema and row counts\nSELECT * FROM parquet_metadata('events.parquet');\nSELECT * FROM parquet_schema('events.parquet');\n```\n\nDuckDB's Parquet support makes it an excellent tool for building lightweight data pipelines: ingest raw data from any format, transform it with SQL, and write optimized Parquet files for downstream consumers.\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002FTerminalSkills\u002Fskills\u002Fduckdb",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill duckdb",{"tool":37,"command":38},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill duckdb",{"tool":40,"command":41},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill duckdb","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Fduckdb\u002FSKILL.md",true,[],[46,55,64,73,79,85],{"skillNo":47,"name":48,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":49,"categories":50,"keywords":51,"publishedAt":18},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[52,53,54],"model","model hierarchy","model hierarchy skill",{"skillNo":56,"name":57,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":18},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[61,62,63],"MCP","zoom","zoom mcp",{"skillNo":65,"name":66,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":18},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[70,71,72,62],"sdk","zoom apps sdk","apps",{"skillNo":74,"name":75,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":18},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[75],{"skillNo":80,"name":81,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":18},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[81],{"skillNo":86,"name":87,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":18},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[87]]