This is the eighth in a series of articles
about writing a small reading list app in Go for personal use.
Sometimes there are operations that need to be done on the app that don’t
need to be built into the frontend. Administrative process like backups,
database migrations, or – the thing we’re going to do today – bulk data
I’ve got a CSV dump of my Goodreads books, and I want to import those into
Aklatan’s db. I only need to do this once, so I don’t need to mess around
with making a web form for it. It just needs a backend administrative
command to perform the import as a one-off process.
By the end of this post we’ll have:
- a command that loads data from the Goodreads CSV export into
- knowledge of how to use raw SQL – we won’t use Gorm for this task
And we’ll do it in less than 75 lines of code.