The recipe follows these basic principles: Connect to the input database. Query table PRAGMA to extract column names. Fetch all table content. Write all table content to CSV.