Private Issues: Consistent Nullable Fields #453
Labels
No labels
Backlog Status
Needs Review
Backlog Status
Ready
Chore
points
01
points
02
points
03
points
05
points
08
points
13
Priority
High
Priority
Low
Priority
Medium
Sprint Status
Blocked
Sprint Status
Done
Sprint Status
In Progress
Sprint Status
Review
Sprint Status
To Do
Technical Debt
Work Item
Bug
Work Item
Epic
Work Item
Spike
Work Item
Task
Work Item
User Story
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
#113 Private Issues
forge/forge
Reference
forge/forge#453
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Storytime
As a Forgejo developer or community contributor,
I want that nullable DB fields are expressed in a consistent way,
to avoid that using different ways confuse me.
As a Forgejo contributor,
I want that pointers are used sparingly,
to reduce the risk of attempting to dereference
nilpointers.Acceptance Criteria
IssueId,PrivateIssueIDstyle pairs of database fields usesql.NullInt64types instead of pointersBackground
I only now noticed that other tables with nullable fields use
sql.Null*types instead of pointers to express that a field can be null (and won’t be set to0on insertion if unspecified like with the non-pointer type). Additional advantages are a) that these can’t benil, preventing crashes when naïvely accessing NULL values, and b) these types allow to distinguish between the null-value of the type and a NULL in the table column.Fixed in my feature branch in “feat: Private Issues: Foundational changes”.