SQL scripts for generating CSV files of FOIArchive data.
Clone this repo.
- Connect to the FOIArchive PostgreSQL database via psql
- Run the script using the \i command. For example:
~# \i entities.sql
\copy foiarchive.entities to `entities-foiarchive-202409.csv`
COPY 12785
- Run gzip on the resulting file and upload to the external-shares drive.
- Version the CSV file by including date or version number in its file name.
- Use foiarchive2json if your query includes doc.body.
- Add additional SQL scripts as needed.