QDG Knowledge Base Read-only viewer QWebHub
general

Database

Version 1 · Initial database doc based on codebase exploration

QDG CMS — Database

No direct database access

This repository contains no direct database access of any kind — no ORM, no SQL driver, no connection string, no database config. A repo-wide search for sql|mysql|postgres|mongo|prisma|knex|sequelize|typeorm|database across src/**/*.ts(x) only turns up developer comments annotating what the backend persists — not actual database code.

All persistence is mediated by two external systems:

  1. QDG CMS API (.NET 9 Web API, separate repo — see the qdg-cms-api KB project) — owns the actual relational database and all reads/writes to it. This frontend only ever calls its REST endpoints (see API Documents).
  2. Wasabi (S3-compatible object storage) — stores raw media file bytes (photos, videos, and photo size variants) directly, via presigned URLs. The CMS API never touches these bytes; it only stores the resulting object keys.

For authoritative schema documentation, consult the qdg-cms-api project's database docs. What follows is the schema shape inferred only from inline comments in this frontend repo, useful as context but not authoritative.

Inferred backend tables (from code comments)

Referenced by table name in comments across src/pages/CreateStoryPage.tsx, src/services/api/imageService.ts, src/services/api/storyService.ts, src/types/story.ts, and src/utils/storyMappings.ts:

  • photogallery.tblphotos — legacy photo/media table (predates the qdg media schema this app now targets via mediaService).
  • tblcms — story/content records.
  • tblcms_site — site lookup (used for story classification, linked to /Lookup/sites).
  • tblcms_newstype — news-type lookup, scoped per site (/Lookup/news-types?siteIds=).
  • qdb.races — race reference data, joined against horses/jockeys/trainers/courses (/Lookup/horses, /Lookup/trainers, /Lookup/jockeys, /Lookup/courses, /Lookup/races?courseId=), consistent with the wider QDG racing-data platform (see qds-router, titan-command).

These names suggest the backend spans at least two schema generations: an older photogallery/tblcms* naming convention and a newer qdg/Media naming convention that the current mediaService/storyService API surface targets — consistent with the "legacy Appsmith to React" migration this app is part of (see Project Architecture).

Media object storage shape

Not a database, but the closest thing this frontend directly shapes: each photo media record carries up to 5 independently-stored size-variant object keys — smallObjectKey, mediumObjectKey, hdObjectKey, hiresObjectKey, largeObjectKey (src/types/media.ts) — pointing at objects in Wasabi. Videos store a single object key with no variants. See API Documents for the upload/registration flow that populates these keys.

Recommendation

Treat this page as a pointer, not a source of truth. Any real schema change, migration, or table documentation belongs in the qdg-cms-api KB project, since that service owns the database.

Updated by Claude on Sept. 2, 2026, 6:21 a.m.