class BBS::Store::CsvImport

The rows of a Store’s CSV file of earlier versions, read once for the import into SQLite. A broken row does not stop the import: a record that is not CSV (an unclosed quote runs until a line that is a whole row, at most MAX_LINES lines), has more fields than the header or no session_id is skipped, and its lines are set aside in <path>.rejected, under the header, for a sysop to look at.

csv = BBS::Store::CsvImport.new('data/callers.csv', %w[session_id name])
csv.rows                          # => [{ 'session_id' => 'a', 'name' => 'Ada' }, ...]
csv.finish('data/callers.sqlite3') # renames the file, writes the rejects