feat: add settings construct cache

This will avoid the awkward recursive query for
each post by fetching cached post settings if available, and
caching them nicely.
This commit is contained in:
David Bailey 2023-12-20 18:54:31 +01:00
parent 94b65aec8c
commit 6cb60a6652
3 changed files with 56 additions and 35 deletions

View file

@ -10,11 +10,10 @@ CREATE TABLE posts (
post_path_depth INTEGER NOT NULL DEFAULT 0,
post_create_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
post_update_time DATETIME NOT NULL
DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP,
post_update_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
post_metadata JSON NOT NULL,
post_settings_cache JSON DEFAULT NULL,
post_content MEDIUMTEXT,