Skip to content

Allow advanced users to download a copy of the CatDat database#125

Merged
ScriptRaccoon merged 7 commits intomainfrom
deploy-database-file
Apr 23, 2026
Merged

Allow advanced users to download a copy of the CatDat database#125
ScriptRaccoon merged 7 commits intomainfrom
deploy-database-file

Conversation

@ScriptRaccoon
Copy link
Copy Markdown
Owner

@ScriptRaccoon ScriptRaccoon commented Apr 23, 2026

This PR offers advanced users to download a snapshot of the database and inspect the data in a terminal or with any database tool of their choice.

The download link is located in a new page /download. That page also lists a couple of interesting example queries.

How it looks like

download page

Interesting Example Query

-- Top 10 properties with the most undecided categories
SELECT
	p.id AS property_id,
	COUNT(c.id) AS undecided_categories
FROM properties p
CROSS JOIN categories c
LEFT JOIN category_property_assignments cp
	ON cp.category_id = c.id
	AND cp.property_id = p.id
WHERE cp.property_id IS NULL
GROUP BY p.id
ORDER BY undecided_categories DESC LIMIT 10;

Separation of Concerns

This feature is only possible because previously (#39 + #119) a clear cut was made between the CatDat database (which contains mathematical knowledge) and the application database (user submissions + page visits + more in the future).

@ScriptRaccoon ScriptRaccoon marked this pull request as ready for review April 23, 2026 02:10
@ScriptRaccoon ScriptRaccoon changed the title Allow users to download a copy of the CatDat database Allow advanced users to download a copy of the CatDat database Apr 23, 2026
@ScriptRaccoon ScriptRaccoon merged commit ad7d6c7 into main Apr 23, 2026
2 checks passed
@ScriptRaccoon ScriptRaccoon deleted the deploy-database-file branch April 23, 2026 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant