Advertisement
Guest User

Untitled

a guest
Mar 6th, 2023
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. const result = await this.pool.query`
  2. INSERT INTO snapshots
  3. (
  4. user_id, room_id, tiktok_id, nickname, is_following, is_friend, is_new_gifter,
  5. is_moderator, is_subscriber, top_gifter_rank, gifter_level, following_count, follower_count
  6. )
  7. OUTPUT INSERTED.id
  8. VALUES
  9. (
  10. ${user_id},
  11. ${room_id},
  12. ${user["user_id"]},
  13. ${user['nickname']},
  14. ${parseBoolAsInt(user["is_following"])},
  15. ${parseBoolAsInt(user["is_friend"])},
  16. ${parseBoolAsInt(user["is_new_gifter"])},
  17. ${parseBoolAsInt(user["is_moderator"])},
  18. ${parseBoolAsInt(user["is_subscriber"])},
  19. ${user["top_gifter_rank"] == null ? null : parseInt('top_gifter_rank')},
  20. ${user['gifter_level']},
  21. ${user?.["info"]?.["following"]},
  22. ${user?.["info"]?.["followers"]}
  23. )
  24. `;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement