Duckalog Examples¶
Welcome to the Duckalog examples collection! These practical examples demonstrate real-world usage patterns and help you get started with different Duckalog configurations.
Choosing an Example¶
Use this guide to find the right example for your use case:
I'm getting started with Duckalog¶
→ Start with: Simple Parquet Example - Learn the basics of creating DuckDB views over Parquet files - Perfect for simple analytics without complex joins - Covers local files and S3 storage
I need to combine multiple local databases¶
→ Use: Local Attachments Example - Attach DuckDB and SQLite databases - Join data across different local databases - Learn read-only attachment patterns
I have data in multiple sources (Parquet + databases + cloud storage)¶
→ Follow: Multi-Source Analytics Example - Comprehensive example with S3, PostgreSQL, Iceberg, and local databases - Real-world analytics workflow - Complex joins and business logic
I need to deploy configs across different environments¶
→ Read: Environment Variables Example - Secure credential management - Development, staging, and production configurations - Docker and Kubernetes deployment patterns
I want to fine-tune DuckDB performance and behavior¶
→ Explore: DuckDB Settings Example - Configure session-level settings beyond pragmas - Optimize threading, memory, and caching - Control DuckDB features and progress output
I need to manage credentials for cloud services and databases¶
→ Use: DuckDB Secrets Example - Secure credential management for S3, Azure, GCS, and databases - Support for environment variable interpolation - Persistent and temporary secrets with scoping - Integration with attachments and Iceberg catalogs
Quick Comparison¶
| Example | Difficulty | Data Sources | Key Learning |
|---|---|---|---|
| Simple Parquet | 🟢 Beginner | Parquet files | |
| Local Attachments | 🟡 Intermediate | DuckDB/SQLite | |
| Multi-Source Analytics | 🔴 Advanced | Multiple sources | |
| Environment Variables | 🟡 Intermediate | Any | |
| DuckDB Settings | 🟡 Intermediate | Any | |
| DuckDB Secrets | 🟡 Intermediate | Any |
Prerequisites for All Examples¶
Required Software¶
- Python 3.12+ with Duckalog installed:
Optional but Recommended¶
-
DuckDB CLI for interactive querying:
-
AWS CLI (for S3 examples):
Example Categories¶
By Data Source¶
Parquet Files Only - Simple Parquet - Perfect starting point - Multi-Source Analytics - Includes Parquet with other sources
Local Databases - Local Attachments - DuckDB and SQLite focus - Multi-Source Analytics - Local databases with cloud sources
Cloud Storage & Data Lakes - Simple Parquet - S3 configuration - Multi-Source Analytics - S3 + Iceberg catalogs - Environment Variables - Cloud credential management
Enterprise/Production - Multi-Source Analytics - Production-ready patterns - Environment Variables - Deployment and security
By Use Case¶
Data Analytics - Simple Parquet - Basic analytics - Local Attachments - Cross-database analytics - Multi-Source Analytics - Enterprise analytics
Data Integration - Local Attachments - Local data unification - Multi-Source Analytics - Cloud + local integration
Development & Deployment - Environment Variables - Environment-specific configs - Multi-Source Analytics - Production deployment patterns
Common Patterns Across Examples¶
All examples demonstrate these important Duckalog concepts:
- Configuration Structure - Consistent YAML patterns
- View Composition - Building complex analytics from simple views
- Performance Optimization - Memory limits, threading, pragmas
- Error Handling - Validation and troubleshooting
- Best Practices - Security, maintainability, scalability
Getting Started¶
- Choose your example based on your use case above
- Read the prerequisites in your chosen example
- Follow the step-by-step guide provided in each example
- Experiment with the configurations to match your needs
- Combine patterns from multiple examples as needed
Next Steps¶
After working through examples:
- Read the User Guide in
../guides/index.mdfor comprehensive documentation - Explore the API Reference in
../reference/index.mdfor detailed function documentation - Review the Architecture in
../architecture.mdfor high-level design details - Join the community for questions and discussions
Contributing Examples¶
Have a great Duckalog pattern to share? Consider contributing:
- Create a new example following the patterns shown here
- Include clear explanations and real-world scenarios
- Add troubleshooting sections for common issues
- Ensure examples work with minimal setup
- Link from this index page
Need Help?¶
- Configuration Issues: Check troubleshooting sections in examples
- API Questions: See API Reference
- General Usage: Review User Guide
- Technical Details: Read Architecture
Choose an example above to get started, or explore them in order to build your Duckalog expertise progressively!