attach-db

Attach DuckDB databases and explore schemas for interactive SQL querying.

527|26|Updated Mar 10, 2026
One-click install
npx skills add https://github.com/duckdb/duckdb-skills --skill attach-db-duckdb
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: attach-db
Source: https://github.com/duckdb/duckdb-skills/tree/main/skills/attach-db
Command: npx skills add https://github.com/duckdb/duckdb-skills --skill attach-db-duckdb

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill allows users to attach DuckDB database files for interactive querying, enabling them to explore data and execute SQL queries directly within their environment.

Core Features & Use Cases

  • Attach Database: Connect to a DuckDB database file for querying.
  • Schema Exploration: Automatically explore the schema of the attached database, including tables and row counts.
  • State File Management: Manages a SQL state file for session persistence.
  • Use Case: Ideal for data analysts or engineers who need to quickly attach a database and start querying without setting up a separate environment.

Quick Start

Attach a DuckDB database file 'my_analytics.duckdb' for querying.

Frequently Asked Questions about attach-db

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I attach a DuckDB database file for interactive SQL querying?

To attach a DuckDB database file for interactive SQL querying, you connect to the database file directly within your environment. This enables you to execute SQL queries and explore data without setting up a separate database server.

How does schema exploration work after attaching a DuckDB database?

Schema exploration automatically maps the attached DuckDB database structure, identifying available tables and their row counts. This allows you to quickly understand the dataset layout before executing interactive SQL queries.

Can I use this approach to query DuckDB databases without setting up a separate environment?

Yes, you can query DuckDB databases without setting up a separate environment. This approach attaches the database file directly, making it ideal for data analysts and engineers who need immediate interactive querying access.

What is the best way to manage SQL session state when interacting with a DuckDB database?

The best way to manage SQL session state is by using a managed SQL state file. This ensures session persistence during interactive DuckDB querying, keeping your database attachment and exploration context intact.

Does DuckDB database attachment support data analysis workflows requiring quick schema access?

Yes, DuckDB database attachment supports data analysis workflows requiring quick schema access. It automatically explores the database schema and manages session state, streamlining the process of interactive querying for analysis.