QuackDB
A DuckDB API with ergonomic high-level API without sacrificing the ability to go low level.
Compared to duckdb-rs
- QuackDB avoids lifetime on API where possible
- Database objects are reference-counted
- This avoids the need to store parent objects explicitly
- QuackDB does not attempt to mimic Rusqlite API
- QuackDB data access and processing is centered around Arrow
API Level
The main API is the high level, safe API.
quackdb-internal contains wrappers over types from libduckdb-sys with Rust types.
These types are only used for object lifetime management.
Raw FFI handles can be accessed by dereferencing either high level or wrapper structures.
API Support
| C API | High Level |
|---|---|
| Database | Yes |
| Connection | Yes |
| Config | Yes |
| Query | Arrow |
| Data Chunks | No |
| Values | No |
| Types | Partial |
| Statements | Yes |
| Appender | Yes |
| Table Functions | Almost |
| Replacement Scans | No |
- Query results require working with arrow
RecordBatchdirectly - Table functions are supported, but it has to work with data chunks directly via FFI
- Currently, DuckDB types, Arrow types, and Rust types are not fully reconciled
API conventions
- High level API expose low level handle types as
pub handlefield - High level API follow Rust naming
- Low level API wraps raw handle and all basic operations
- Low level API dereferences to raw handle
- Low level API use Rust types
- Low level API follow DuckDB naming
Roadmap -- 0.4.0
- Fix document build
- DuckDb types conversion
- Rust primitive types to/from DuckDb types
- Chrono to/from DuckDb
- Remove intermediate API
- Replacement scans
Roadmap -- 0.5.0
- Compound logical type in Rust
Roadmap -- Future
- Full support of table function
- Serde support
- Clean up error types
- Clean up receivers
- Make naming consistent
- Comprehensive documentation
- Comprehensive tests
- Streaming arrow (optional)