Repository navigation
v0.1.23
v0.1.23 - 2026-09-01
🩹 Fixes
- Fixed
Database.knex()recreating the Knex instance (connection pool) and re-reading the config file (fs.existsSync+require()) on every invocation
📖 Changes
Database.knex()now returns a lazily cached singleton Knex instance; the config is read once and reused until explicitly reset- Added
Database.reset()to destroy the cached connection pool and clear the builder, so CLI commands can cleanup without breaking the shared instance - Migrate/seed commands now use
Database.reset()instead ofdatabase.destroy() - Migrate/seed commands now use
chalkdirectly for spinner/confirmation colors, replacing the removed@bejibun/logger/facades/Chalkfacade - Extracted the duplicated migration/seeder creation pipeline in the make commands into a shared
MakeHelper(single-passlatestCounter(),nextFileName(),resolveTemplate());latestCounter()also tolerates a missingdatabase/directory - Removed
defineValue()usage in the make commands in favor of a counter returned directly as a number - Added
teststo tsconfigexcludeso compiled output never lands intests/
🧪 Tests
- Added test suite (11 tests across 1 file) covering
Database.knex()caching,Database.reset(), config reuse, and theMakeHelperhelpers
⚡ Benchmarks
- Added benchmark suite comparing baseline (
@bejibun/database@0.1.21) vs optimized build - Database.knex() throughput: ~1128.89x faster (0.4ms vs 451.5ms, ~50M ops/s)
- Cold start: ~1.01x
📦 Dependencies
- Bumped
@bejibun/appfrom^0.1.25to^0.1.26 - Bumped
@bejibun/loggerfrom^0.1.23to^0.2.1 - Bumped
@bejibun/utilsfrom^0.1.29to^0.1.30 - Added
chalk^6.0.0 - Bumped
@types/bun(devDependency) from^1.3.14to^1.4.0 - Bumped
eslint(devDependency) from^10.8.1to^10.9.1 - Bumped
tsc-alias(devDependency) from^1.9.2to^1.9.3 - Bumped
typescript-eslint(devDependency) from^8.67.0to^8.69.0
❤️Contributors
- Havea Crenata (@crenata)
Full Changelog: https://github.com/Bejibun-Framework/bejibun-database/blob/master/CHANGELOG.md