doc: update TODOs, general housekeeping
This commit is contained in:
23
doc/TODO.txt
23
doc/TODO.txt
@@ -1,13 +1,6 @@
|
|||||||
TODO: soft-deletion
|
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
|
- 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
|
IDEA: migrations-table
|
||||||
- Store migrations in a table. This makes the schema more self-documenting.
|
- 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)
|
- 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
|
TODO: join-tables
|
||||||
- handle codegen for without rowid tables properly
|
- handle codegen for without rowid tables properly
|
||||||
- add "get all X for Y"
|
- add "get all X for Y"
|
||||||
|
- Example: `chat_pinned_messages`
|
||||||
TODO: create a Getter function for each unique index
|
|
||||||
|
|
||||||
TODO: consider CreateDB and CreateMemoryDB
|
TODO: consider CreateDB and CreateMemoryDB
|
||||||
|
|
||||||
TODO: generate tests for the remaining CRUD, try to hit ~100% default test coverage
|
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
|
||||||
|
|||||||
@@ -29,6 +29,12 @@
|
|||||||
|
|
||||||
- `ops` directory
|
- `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
|
### Borrowed from Ruby On Rails
|
||||||
|
|
||||||
- Convention Over Configuration
|
- Convention Over Configuration
|
||||||
|
|||||||
@@ -10,4 +10,5 @@ sudo docker run --rm -it \
|
|||||||
-v /memory:/memory \
|
-v /memory:/memory \
|
||||||
--workdir /code \
|
--workdir /code \
|
||||||
--net host \
|
--net host \
|
||||||
|
--name gas \
|
||||||
gas
|
gas
|
||||||
|
|||||||
0
ops/test.sh
Normal file → Executable file
0
ops/test.sh
Normal file → Executable file
Reference in New Issue
Block a user