Read handles from the new plc mirror

main
Max Ignatenko 2024-06-24 16:31:50 +01:00
parent 9cc2572666
commit de51bd9015
1 changed files with 10 additions and 2 deletions

View File

@ -50,5 +50,13 @@ EOF
# ------------------------------ Dump handles from plc-mirror ----------------------------------
docker exec -t plc-postgres-1 psql -U postgres -d plc \
-c 'copy (select handle, did as "did:ID" from actors) to stdout with (format csv , header, force_quote ("handle"));' | sed -E -e 's/([^\\])\\",/\1\\\\",/g' > handles.csv
docker compose exec -iT postgres psql -U postgres -d bluesky <<- EOF | sed -E -e 's/([^\\])\\",/\1\\\\",/g' > handles.csv
\timing
select did as "did:ID", replace(operation['alsoKnownAs'] ->> 0, 'at://', '') as handle
from plc_log_entries
where (did, plc_timestamp) in (
select did, max(plc_timestamp) as plc_timestamp from plc_log_entries
where not nullified
group by did
)
EOF