Description
I would like to inject custom code to transform item documents in some way as they travel from database to the user. I feel like this would be a useful feature to have regardless of the db backend.
My specific use-case is to adjust asset hrefs from relative paths to absolute based on the original self link recorded in the database. I would like to keep storing relative links for assets in the database, but since item self link changes when accessed over api those hrefs become invalid. Recording those in absolute form would solve this specific problem, but makes data relocation more involved.
Alternatively an option to "make asset href absolute using original self link" can be useful and avoids the need to write custom code.
in pgstac this can inside this function for example:
stac-fastapi/stac_fastapi/pgstac/stac_fastapi/pgstac/core.py
Lines 187 to 191 in 162a1a2