feat: add get_event
This commit is contained in:
parent
0d61f433c6
commit
25d41d094c
1 changed files with 10 additions and 0 deletions
10
crud.py
10
crud.py
|
|
@ -85,6 +85,16 @@ async def get_events(relay_id: str, filter: NostrFilter) -> List[NostrEvent]:
|
|||
return events
|
||||
|
||||
|
||||
async def get_event(relay_id: str, id: str) -> Optional[NostrEvent]:
|
||||
row = await db.fetchone("SELECT * FROM nostrrelay.events WHERE relay_id = ? AND id = ?", (relay_id, id,))
|
||||
if not row:
|
||||
return None
|
||||
|
||||
event = NostrEvent.from_row(row)
|
||||
event.tags = await get_event_tags(relay_id, id)
|
||||
return event
|
||||
|
||||
|
||||
async def create_event_tags(
|
||||
relay_id: str, event_id: str, tag_name: str, tag_value: str, extra_values: Optional[str]
|
||||
):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue