From 95bc7da83e2aabfd95d99f9ec82f0dee29c69cf9 Mon Sep 17 00:00:00 2001 From: openhands Date: Fri, 23 Oct 2026 20:09:35 +0200 Subject: [PATCH] Add professional documentation for multi-engine database architecture in README --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 0767762c..18150e00 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,14 @@ The CMS reads emulator-owned tables (`users`, `items`, `rooms`, `bans`, etc.) di > **Note:** The CMS does **not** own the emulator schema — it maps to those tables via Drizzle. Never run `drizzle-kit push` / `migrate` against the shared DB. CMS-owned tables (`website_*`, `radio_*`, etc.) are created via idempotent SQL in `drizzle/migrations/`. +#### Multi-Engine Architecture & Dialect Routing + +EpicNext-CMS features a robust, multi-dialect database abstraction layer powered by **Drizzle ORM**. Depending on the connection string protocol supplied in `DATABASE_URL`: +- **MySQL / MariaDB (`mysql://`)**: Utilizes `mysql2/promise` connection pooling with optimized keep-alive, named placeholders, and strict statement hardening. +- **PostgreSQL (`postgres://` / `postgresql://`)**: Utilizes `node-postgres` (`pg.Pool`) with high-performance async client handling. + +The query builder and helper functions (`queryRows`, `execResult`, `affectedRows`) automatically normalize driver-specific responses (`ResultSetHeader` vs PostgreSQL result objects), ensuring seamless compatibility across database engines without application-layer changes. + ### 3. Configure Environment ```bash