Documentation Index
Fetch the complete documentation index at: https://mintlify.com/embucket/embucket/llms.txt
Use this file to discover all available pages before exploring further.
Getting Started
This guide covers everything you need to know to start developing Embucket, from setting up your environment to understanding our coding conventions.Prerequisites
Rust Toolchain
Install Rust and Cargo from rustup.rs
Git
Version control system for cloning the repository
Build from Source
Follow these steps to build Embucket from source:Running Tests
Run the test suite:Building for AWS Lambda
Embucket can be deployed as an AWS Lambda function. To build for Lambda:Read the cargo-lambda documentation for more details on configuring IAM roles and function URLs.
Coding Standards
Embucket follows strict coding conventions to ensure code quality and consistency across the codebase.Design Conventions
Error Definitions
Define errors with display messages in dedicated
errors.rs files. Avoid inlining error texts outside of those files.Error Types
Define
Error enum and Result<T> types per crate, with public visibility.API Error Handling
Implement
IntoResponse trait for top-level error for API crates.Error Logging
Errors in logs and tracing spans/events should include an error stack trace.
Error Handling with Snafu
Embucket uses the Snafu error library for consistent error handling across the codebase, along witherror_stack_trace::debug proc macro for enabling error stack traces.
Error Construction and Propagation
Basic Error Definition
Basic Error Definition
Derive from
Snafu and use the error_stack_trace::debug proc macro when defining error enums:Restricting Selector Visibility
Restricting Selector Visibility
Restrict generated Snafu selectors’ visibility to crate level:
Error Conversion Helpers
Error Conversion Helpers
Use Snafu’s helpers for implicit error conversions:
.context(...)- also supports chaining.build().fail().into_error()
.map_err(...) which is considered an anti-pattern due to loss of context and less ergonomic traceability.Special Error Cases
- Non-Snafu Foreign Errors
- Boxing Large Errors
- Transparent Errors
When nesting a non-Snafu foreign error, rename its field from
source to error and add #[snafu(source)]:Error Propagation Best Practices
- Use the
?operator for implicit error conversions when propagating errors - Avoid
.map_err(...)- it’s generally considered an anti-pattern - Chain context when errors pass through multiple layers to provide better error messages
- Include stack traces by using the
error_stack_trace::debugproc macro
Project Architecture
Embucket is built on proven open source technologies:Apache DataFusion
Powers SQL execution engine
Apache Iceberg
Provides ACID table metadata and storage format
Key Features
- Snowflake SQL dialect and API: Wire-compatible with existing Snowflake queries, dbt projects, and BI tools
- Apache Iceberg storage: Data stays in Apache Iceberg format on object storage with no lock-in
- Single binary deployment: Radical simplicity in deployment
- Query-per-node: Each instance handles complete queries independently
- Horizontal scaling: Add nodes for more throughput
Development Workflow
Discuss your changes
Before making significant changes, discuss them with the maintainers via GitHub Discussions or by opening an issue.
Submit a pull request
See the Contributing Guide for detailed PR submission instructions.
Getting Help
If you need help with development:GitHub Discussions
Ask questions and get help from the community
Contributing Guide
Review the full contributing guidelines