gofmt compliant.
moved snake case to camel case.
Adding MIT license.
move flags to top of file.
don't make sql queries to determine total size.

Turns out, SQL queries are much slower than allocating an in-memory
data structure. These are things you forget when working in high-level
python all the time. :-x
Literal strings for SQL statements, rather than string concatenation.