Fix csv_export and Makefile
parent
0e01664cfb
commit
d6dff5a9a0
1
Makefile
1
Makefile
|
@ -54,7 +54,6 @@ init-db: init.sql
|
||||||
csv-export:
|
csv-export:
|
||||||
|
|
||||||
@nohup ./csv_export.sh > csv_export.out &
|
@nohup ./csv_export.sh > csv_export.out &
|
||||||
@tail -f csv_export.out
|
|
||||||
|
|
||||||
kill-csv-export:
|
kill-csv-export:
|
||||||
@kill -9 `pgrep csv_export.sh`
|
@kill -9 `pgrep csv_export.sh`
|
||||||
|
|
|
@ -32,6 +32,10 @@ docker compose exec -it postgres psql -U postgres -d bluesky \
|
||||||
-c "copy (${likes_query}) to stdout with csv header;" > like_counts.csv
|
-c "copy (${likes_query}) to stdout with csv header;" > like_counts.csv
|
||||||
echo "Done: $(ls -lh like_counts.csv)"
|
echo "Done: $(ls -lh like_counts.csv)"
|
||||||
|
|
||||||
|
# ------------------------------ LIKES ----------------------------------
|
||||||
|
|
||||||
|
# ------------------------------ REPLIES ----------------------------------
|
||||||
|
|
||||||
posts_query="$(cat <<- EOF
|
posts_query="$(cat <<- EOF
|
||||||
select repos.did as ":START_ID", subject_did as ":END_ID", "count:long" from
|
select repos.did as ":START_ID", subject_did as ":END_ID", "count:long" from
|
||||||
repos join lateral (
|
repos join lateral (
|
||||||
|
@ -41,10 +45,6 @@ posts_query="$(cat <<- EOF
|
||||||
EOF
|
EOF
|
||||||
)"
|
)"
|
||||||
|
|
||||||
# ------------------------------ LIKES ----------------------------------
|
|
||||||
|
|
||||||
# ------------------------------ REPLIES ----------------------------------
|
|
||||||
|
|
||||||
echo "Dumping posts..."
|
echo "Dumping posts..."
|
||||||
docker compose exec -it postgres psql -U postgres -d bluesky \
|
docker compose exec -it postgres psql -U postgres -d bluesky \
|
||||||
-c "copy (${posts_query}) to stdout with csv header;" > post_counts.csv
|
-c "copy (${posts_query}) to stdout with csv header;" > post_counts.csv
|
Loading…
Reference in New Issue