CatDat is based on a SQLite database. During runtime of the application, it is read-only.
The local copy of the database is located at /database/local.db. It has three main tables:
categoriespropertiesimplications
To associate properties with categories (satisfied or not), there is a table:
category_property_assignments
To mark properties as assumptions or conclusions of an implication, there are two tables:
implication_assumptionsimplication_conclusions
But they are abstracted away by using the view implications_view.
Further tables are:
tagscategory_tagsrelated_categoriesrelationsspecial_object_typesspecial_objectsspecial_morphism_typesspecial_morphismsrelated_propertiescategory_commentslemmas(a flexible variant of implications)
Migrations update the database structure: tables, views, indexes, and triggers. They are defined in SQL files located in the subfolder /database/migrations. The command pnpm db:migrate applies any new migrations.
Database entries (categories, properties, implications, etc.) are defined via SQL files in the subfolder /database/data. The command pnpm db:seed replaces the current database by clearing all existing data and inserting the entries defined in these SQL files.
From the defined satisfied properties of a given category, new properties can be automatically deduced using the implications. (For example, when a category has equalizers and products, we can infer that it is complete.) The same applies to unsatisfied properties. Additionally, suitable implications may be dualized, and a category inherits all dualized properties of its dual category, if available. Note that the SQL files mentioned above do not contain any derived data.
The command pnpm db:deduce deduces implications, satisfied properties, and unsatisfied properties.
The command pnpm db:test executes some tests and verifies that the data behaves as expected.
Use pnpm db:update to run all the commands in sequence: pnpm db:migrate, pnpm db:seed,pnpm db:deduce, and pnpm db:test.
Use pnpm db:watch to run this command automatically every time a file in the subfolder /database/data changes. This is useful in particular during development.
This is the database schema as of 13.04.2026; changes may occur.