connect_database 1.0.0
connect_database: ^1.0.0 copied to clipboard
A Flutter package for ODBC database connectivity with support for SQL Server, PostgreSQL, and Sybase Anywhere. Features connection pooling, bulk operations, query metrics, and automatic SELECT interce [...]
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.0.0 - 2025-01-19 #
Added #
- Initial release of connect_database package
- ODBC database connectivity for SQL Server, PostgreSQL, and Sybase Anywhere
- Connection pooling with waiting queue and health check
- Bulk operations (INSERT/UPDATE/DELETE) with optimized batch sizes
- Query metrics callback for performance monitoring
- Automatic SELECT interception with intelligent CAST
- LRU cache for metadata (100 entries, 8-minute TTL)
- Pre-compiled regex patterns for +30-40% faster query interception
- Buffered streaming for large datasets
- Transaction support (COMMIT/ROLLBACK)
- Safe SELECT builder to avoid binary column errors
- Table metadata queries
- Schema utilities (create/alter table, column operations)
- Complete test coverage (157 tests, 100% passing)
- Comprehensive documentation with 38 code examples
Performance #
- Connection pool with automatic validation and waiting queue
- Database-specific batch sizes (SQL Server: 1000, PostgreSQL: 500, Sybase: 1000)
- LRU cache prevents unbounded memory growth
- Regex pre-compilation eliminates repeated allocations
- Bulk operations reduce round-trips by 90%+
Reliability #
- Automatic connection health check (5-minute intervals)
- Connection validation before reuse
- Timeout-configurable pool acquisition (default: 30s)
- Automatic stale connection removal
- Result-based error handling with result_dart
Documentation #
- Complete README with 38 examples
- Performance & reliability guide
- Connection pool configuration examples
- Query metrics usage examples
- Best practices section
- Troubleshooting guide