doc: update TODOs, general housekeeping

This commit is contained in:
2026-09-19 21:36:31 -07:00
parent b064948d24
commit 741709623b
4 changed files with 21 additions and 9 deletions

View File

@@ -1,13 +1,6 @@
TODO: soft-deletion
- enable soft-deletion if table has `is_deleted` and `deleted_at` fields
- if soft delete is enabled, DeleteXyz should do update (not delete) and set is_deleted and deleted_at
- ...and DeleteXyz should have pointer receiver for soft-delete
- GetXyzByID should include `ErrItemIsDeleted` if item is soft-deleted
TODO: migration-structs
- Right now, migrations are strings. Could be a struct with "name", "up" and "down" fields
- Adding a "down" operation enables handling newer DB versions with "down instead of error-out" for development (perhaps a flag)
IDEA: migrations-table
- Store migrations in a table. This makes the schema more self-documenting.
- Possible schema: name, sql_up, sql_down, hash (computed from those fields plus previous migration hash)
@@ -27,9 +20,21 @@ TODO: generated test file inclues global test DB setup, which is wrong
TODO: join-tables
- handle codegen for without rowid tables properly
- add "get all X for Y"
TODO: create a Getter function for each unique index
- Example: `chat_pinned_messages`
TODO: consider CreateDB and CreateMemoryDB
TODO: generate tests for the remaining CRUD, try to hit ~100% default test coverage
TODO: test reporter
- coverage: https://x.com/wispem_wantex/status/2009799380648505563
- Jest shows for each file: % of lines, functions, branches and statements covered
- Go reporter should show:
- group coverage stats by either function, file or package
- count by statements, branches or functions
- Show both raw count and percentage
- list which lines / branches / functions were missed
- pretty (terminal) format or JSON format
TODO: foreign key to compound-FK table
- sample: booru_post_tag_votes