readme: add example SQL query

This commit is contained in:
Oneric 2025-11-30 00:00:00 +00:00
commit a40d6d6ed4

View file

@ -35,3 +35,11 @@ Example
./shinyr db2api 00000000-0000-0000-0000-00000000007b
## 123
```
Using a database ID to query both the activity and object of a post:
```sql
SELECT a.*, o.*
FROM objects AS o JOIN activities AS a
ON COALESCE(a.data->'object'->>'id', a.data->>'object') = o.data->>'id'
WHERE a.id = '00000198-70ad-868e-8d3a-6d2726850000';
```