Forge
1.x
Docs/Forge/Database
Open

Deprecated

Use Grove instead.

Reading1 min
Updated31 Jul 2026
Sourcev1/extensions/database/index.mdx

Overview01

github.com/xraph/forge/extensions/database provides a unified extension for:

  • SQL databases via Bun (postgres, mysql, sqlite)

  • MongoDB

  • Redis (standalone, cluster, sentinel)

The extension registers a DatabaseManager and database accessors in the container, then coordinates connection lifecycle.

What This Extension Handles02

  • Config loading from app config (extensions.database then database) plus programmatic options

  • Database object creation by DatabaseType

  • Eager registration/opening of configured databases through DatabaseManager

  • Default database selection

  • Typed helper access for SQL, Mongo, and Redis

Runtime Model03

  • DatabaseManager is the central registry for named databases.

  • Database connections are opened with retry and backoff logic.

  • Health checks and metrics are emitted per database.

  • DatabaseManager implements service lifecycle methods (Start, Stop, Health).

Read This Next04