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

View File

@@ -29,6 +29,12 @@
- `ops` directory
### Reinventing the wheel
Wheels aren't difficult to invent; the concept is very simple. However, there's many different types, shapes and sizes of wheels. The wheel on a shopping cart is different from the wheel on a bicycle, a car, a tractor, a train, a spool of thread, etc.
Reinventing the wheel is good. It's good to use things that are specifically built for your purpose, with exactly the set of features and affordances you need. Using a wheel that was made by someone else for a different purpose can be faster at first, but it's likely that their needs were different from yours.
### Borrowed from Ruby On Rails
- Convention Over Configuration

View File

@@ -10,4 +10,5 @@ sudo docker run --rm -it \
-v /memory:/memory \
--workdir /code \
--net host \
--name gas \
gas

0
ops/test.sh Normal file → Executable file
View File