all: generate json, not code
This includes modifying horsebot to use the generated JSON, as well as moving the generator to another cmd/ directory. Remove the generated code while we're here. Koka tests still have to be updated, but it requires a JSON parser.
This commit is contained in:
14
cmd/horsegen/sql/race.sql
Normal file
14
cmd/horsegen/sql/race.sql
Normal file
@@ -0,0 +1,14 @@
|
||||
WITH race_names AS (
|
||||
SELECT "index" AS id, "text" AS name FROM text_data WHERE category = 33
|
||||
)
|
||||
SELECT
|
||||
race.id,
|
||||
race_names.name,
|
||||
race.grade,
|
||||
race.thumbnail_id,
|
||||
MIN(race.id) OVER (PARTITION BY race_names.name) AS "primary",
|
||||
ROW_NUMBER() OVER (PARTITION BY race_names.name ORDER BY race.id) - 1 AS "alternate"
|
||||
FROM race
|
||||
JOIN race_names ON race.id = race_names.id
|
||||
WHERE race."group" = 1
|
||||
ORDER BY race.id
|
||||
Reference in New Issue
Block a user