bun-query-builder

bun-query-builder

Typed Query Builder for Bun.sql

Model-driven, safe, and blazingly fast database queries

bun-query-builder

🧩 Typed from Models

Infer tables, columns, and primary keys from your data models for a Kysely-like developer experience with full TypeScript safety.

🛡️ Injection-Safe Queries

Built on Bun's tagged SQL templates for automatic parameterization and protection against SQL injection attacks.

🔄 Advanced Transactions

Robust transaction support with automatic retries, exponential backoff, configurable isolation levels, savepoints, and distributed transactions.

🚀 High Performance

Optimized for Bun's native performance with connection pooling, cursor pagination, and efficient batch processing.

🔗 Rich Relations

Intuitive relationship handling with eager loading, relation counting, and existence filtering for complex data modeling.

🛠️ Developer Tools

Comprehensive CLI for schema introspection, query debugging, database connectivity checks, and migration management.

🎯 Multiple Dialects

First-class support for PostgreSQL, MySQL, and SQLite with dialect-specific optimizations and feature detection.

📊 Production Ready

Built-in monitoring hooks, performance tracking, graceful error handling, and operational best practices for enterprise deployment.

Released under the MIT License.