This adds 'shadow' types used only by the store/db internal package whch
handle converting these types to their DB-equivalent values. This change
should allow reports to be generated significantly faster since it
allows a large portion of the computation to be shifted to the database
engines.
Update one SQL query to do an 'INNER JOIN' instead of an 'IN' with a
subquery. This avoids error messages like:
Error 1235: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
This is done by requiring 'parseTime=true' in the MySQL DSN's (required
by github.com/go-sql-driver/mysql when Scan()ing to time.Time's), and
not forcing update counts to match if rows were updated to what they
already were.
Simplify naming to remove "Tx" now that all handlers only have access to
transactions anyway, and always use "tx" as the name of the variable
representing the SQL transactions (to make it less likely to cause
confusion with monetary transactions).