Get acquainted with database code and structures #114

Closed
opened 2025-07-17 08:11:16 +00:00 by nilsph · 3 comments
nilsph commented 2025-07-17 08:11:16 +00:00 (Migrated from codeberg.org)

In order to effectively implement private issues, I need to know how Forgejo accesses the database, how things are stored in it and so forth.

In order to effectively implement private issues, I need to know how Forgejo accesses the database, how things are stored in it and so forth.
nilsph commented 2025-07-22 07:16:26 +00:00 (Migrated from codeberg.org)
  • Forgejo uses plain SQL, xorm.Builder and xorm ORM models
  • xorm doesn’t seem to support modelling foreign key relationships, so generating a DB schema diagram automatically won’t work
- Forgejo uses plain SQL, xorm.Builder and xorm ORM models - [xorm](https://gitea.com/xorm/xorm) doesn’t seem to support modelling foreign key relationships, so generating a DB schema diagram automatically won’t work
nilsph commented 2025-08-05 14:30:38 +00:00 (Migrated from codeberg.org)

Issues, PRs etc. track their IDs in the shared issue_index table via db.GetNextResourceIndex().

Issues, PRs etc. track their IDs in the shared `issue_index` table via `db.GetNextResourceIndex()`.
nilsph commented 2025-08-06 09:18:41 +00:00 (Migrated from codeberg.org)

Issues themselves are spread around >50 files (with >16kLOC 😂). I will be looking for a way not to copy all of that, but that’s outside the scope of this spike.

Issues themselves are spread around >50 files (with >16kLOC 😂). I will be looking for a way not to copy all of that, but that’s outside the scope of this spike.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Blocks
Reference
forge/forge#114
No description provided.