From 302489c3691c5d4285d1d62fdb99ef05d5f79acf Mon Sep 17 00:00:00 2001
From: Bryan Newbold <bnewbold@archive.org>
Date: Thu, 1 Oct 2020 19:51:28 -0700
Subject: dump_file_meta helper

---
 sql/dump_file_meta.sql | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 sql/dump_file_meta.sql

(limited to 'sql/dump_file_meta.sql')

diff --git a/sql/dump_file_meta.sql b/sql/dump_file_meta.sql
new file mode 100644
index 0000000..1028c13
--- /dev/null
+++ b/sql/dump_file_meta.sql
@@ -0,0 +1,12 @@
+
+BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE READ ONLY DEFERRABLE;
+
+COPY (
+  SELECT sha1hex, row_to_json(file_meta)
+  FROM file_meta
+  ORDER BY sha1hex ASC
+)
+TO '/grande/snapshots/file_meta_dump.tsv'
+WITH NULL '';
+
+ROLLBACK;
-- 
cgit v1.2.3

