最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

node.js - How to dynamically change data in a table while selecting in TypeORM & PostgreSQL? - Stack Overflow

programmeradmin3浏览0评论

In my project, I'm trying to save actions that made by users for audit purpose, ex: creating new items, delete smth etc. I'm using postgresql and typeorm. let's say I have history table to save this. this table contains following columns:

id, description, author_id, track_id, track_type, metadata.

here track_type can be users, groups, items.

My question is: how can i save info in description column some dynamic variables. Example:

Изменён период обучения ученика Richard L. с уч. единицей Group Big Apple From 1/28/2025 - 9/30/2025 to 11/1/2024 - 9/30/2025

here Richard L. is link to the users profile and Group Big Apple is link to the groups details page. when user's name or group's name changed, thay are also be changed in history.

I tried to save that name's id in html tag(<a href='groups/1'>{groupName}</a>) and put placeholder for name, and their ids in metadata. but i have no idea how to change placeholders while getting data from history table.

发布评论

评论列表(0)

  1. 暂无评论