diff --git a/doc/TODO.txt b/doc/TODO.txt index 0b32a9e..1b09d2d 100644 --- a/doc/TODO.txt +++ b/doc/TODO.txt @@ -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 diff --git a/doc/gas-stack.md b/doc/gas-stack.md index d29d59a..e363cd5 100644 --- a/doc/gas-stack.md +++ b/doc/gas-stack.md @@ -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 diff --git a/ops/devcontainer/start.sh b/ops/devcontainer/start.sh index 1babf4a..bee9ae7 100755 --- a/ops/devcontainer/start.sh +++ b/ops/devcontainer/start.sh @@ -10,4 +10,5 @@ sudo docker run --rm -it \ -v /memory:/memory \ --workdir /code \ --net host \ + --name gas \ gas diff --git a/ops/test.sh b/ops/test.sh old mode 100644 new mode 100755