Skip to content

v0.1.23

Choose a tag to compare

@crenata crenata released this 01 Sep 09:41
· 2 commits to master since this release

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 of database.destroy()
  • Migrate/seed commands now use chalk directly for spinner/confirmation colors, replacing the removed @bejibun/logger/facades/Chalk facade
  • Extracted the duplicated migration/seeder creation pipeline in the make commands into a shared MakeHelper (single-pass latestCounter(), nextFileName(), resolveTemplate()); latestCounter() also tolerates a missing database/ directory
  • Removed defineValue() usage in the make commands in favor of a counter returned directly as a number
  • Added tests to tsconfig exclude so compiled output never lands in tests/

🧪 Tests

  • Added test suite (11 tests across 1 file) covering Database.knex() caching, Database.reset(), config reuse, and the MakeHelper helpers

⚡ 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/app from ^0.1.25 to ^0.1.26
  • Bumped @bejibun/logger from ^0.1.23 to ^0.2.1
  • Bumped @bejibun/utils from ^0.1.29 to ^0.1.30
  • Added chalk ^6.0.0
  • Bumped @types/bun (devDependency) from ^1.3.14 to ^1.4.0
  • Bumped eslint (devDependency) from ^10.8.1 to ^10.9.1
  • Bumped tsc-alias (devDependency) from ^1.9.2 to ^1.9.3
  • Bumped typescript-eslint (devDependency) from ^8.67.0 to ^8.69.0

❤️Contributors

Full Changelog: https://github.com/Bejibun-Framework/bejibun-database/blob/master/CHANGELOG.md