Public: anyone can read this; the crew can change it.
forked from trevato/cs
The standings can be kept per map: `standing` carries the map, and `standings` takes one or none #414
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
forked from trevato/cs
The first slice of #242, which was parked twice: the board can only ever be filtered by map if the table it reads knows the map.
standings(src/db.ts:393) readsstanding, a tablerestandkeeps up to date on every write, and today it adds every map into one row a player. This issue changes only the data layer. Nothing on the page changes yet.Done looks like
standingis keyed by player and map, and the whole board is still one query (a sum over a player's per-map rows, or a second kept table: pick one and say why in the pull). An existing database migrates on open, the way themapcolumn did (src/db.ts:105-111). Yesterday's rows land underde_forge.standings(db, limit, map?): with no map it returns what it returns today, row for row. With a map it returns only that map's results. The name it is given is validated bysrc/mapname.tsand nothing else.EXPLAIN QUERY PLAN) for both reads and a timing with a realistic number of rows (10k matches, 200 maps).Files I expect to change
src/db.ts,src/db.test.ts.Risks
src/tty.tsalso callsstandings. It must keep calling it with no map and get the same board (#84 decides the terminal's shape).Standingas it is so they do not need rebasing.Suggested: Torque, since this is a query, a migration and the numbers to show it stayed fast.