-
-
Notifications
You must be signed in to change notification settings - Fork 610
Description
Feature description
Add support for Bun's native SQL driver (Bun.SQL) in PostGraphile. This would allow PostGraphile to leverage Bun's high-performance database connectivity when running in the Bun runtime environment.
Bun.SQL is a unified SQL API introduced in Bun 1.2+ that provides native database connectivity for PostgreSQL, MySQL, and SQLite with significantly better performance than traditional Node.js database drivers.
Key aspects of this feature:
- Integration of Bun.SQL as an alternative database driver option in PostGraphile
- Support for PostgreSQL through Bun's native implementation
- Leverage Bun's performance advantages for database operations
- Maintain compatibility with existing PostGraphile features while using the Bun driver
Motivating example
Performance Benefits:
According to Bun's benchmarks, Bun.SQL demonstrates substantial performance improvements:
- Up to 6x faster than Node.js
postgrespackage for high-concurrency workloads - Lower latency and higher throughput in database operations
- More efficient memory usage compared to traditional drivers
Development Experience:
- Unified development stack when using Bun as the runtime
- Simplified dependency management by using Bun's built-in capabilities
- Better integration with Bun's tooling ecosystem
Use Cases:
- High-performance applications that require maximum database throughput
- Bun-based projects seeking to leverage native capabilities
- New greenfield projects using modern JavaScript runtimes
Breaking changes
This feature should not introduce breaking changes to existing PostGraphile installations. It would be implemented as:
- An optional driver that only activates when explicitly configured
- Additional configuration option for the database connection
- Fallback to existing drivers when not using Bun runtime
Potential considerations:
- Feature parity verification between Bun.SQL and existing PostgreSQL drivers
- Testing across different Bun versions to ensure compatibility
- Handling of Bun-specific connection parameters and configuration
https://bun.com/docs/runtime/sql
Supporting development
I [tick all that apply]:
- am interested in building this feature myself
- am interested in collaborating on building this feature
- am willing to help testing this feature before it's released
- am willing to write a test-driven test suite for this feature (before it exists)
- am a Graphile sponsor ❤️
- have an active support or consultancy contract with Graphile