Implements full player get

This commit is contained in:
2024-10-28 00:05:30 +01:00
parent 7903bb7830
commit c8d5540b0d
7 changed files with 178 additions and 5 deletions

22
backend/selectNotes.sql Normal file
View File

@@ -0,0 +1,22 @@
-- 2. Get N most recent notes (10 rows)
select
id as NoteID,
content as NoteContent,
timestamp as NoteTimestamp
from
(
select
n.*,
ROW_NUMBER() OVER (
order by
timestamp desc
) as rn
from
note n
where
n.player = $1
) ranked
where
rn <= $2
order by
timestamp desc;