Question DB is the database repository for the Question diagnostic tool and symptom tracker. It has two purposes:
- Define the data model and persistence contract for the Question application.
- Provide specific database implementations of that contract.
Question DB uses a relational Entity–Attribute–Value (EAV) data model to support flexible, structured data while maintaining explicit relationships and constraints.
A detailed version of the ER diagram, including table fields, data types, keys, and constraints, is located at docs/diagrams.
| Table | Purpose/Description |
|---|---|
| projects | Organize and separate data. |
| types | Define classes that nodes can be assigned to. |
| nodes | Represent the central data points of the application. |
| instances | Represent occurrences of nodes. |
| Table | Purpose/Description |
|---|---|
| type_list_items | Define values that are allowed for the primary data points of nodes. |
| fields | Define attributes for the secondary data points of nodes. |
| field_list_items | Define values that are allowed for the secondary data points of nodes. |
| field_sub_list_items | Define field list items that are subsets of other field list items. |
| node_data | Store the values of a node's secondary data points (fields). |
| instance_fields | Define attributes for the secondary data points of instances. |
| instance_list_items | Define values that are allowed for the secondary data points of instances. |
| instance_sub_list_items | Define instance list items that are subsets of other instance list items. |
| instance_data | Store the values of an instance's secondary data points (instance fields). |
The SQLite implementation provides a lightweight, file-based implementation of the Question DB persistence contract.
docs: SQLite-specific documentation, including setup notes.migrations: Versioned scripts for evolving the schema over time.scripts: Build and utility scripts, including the script that builds the SQLite database file.sql/schema: Individual DDL scripts, one per table, defining the tables, keys, and constraints that make up the data model.sql/schema.sql: A single combined schema file generated from the contents ofsql/schema, used by the build script to create the database in one step.sql/seed: Scripts for populating the database with sample or default data.sql/queries: Common SQL queries for reading and writing Question DB data.tests: Scripts for validating table constraints, triggers, and referential integrity.
