I realize this is kind of stupid, but it means I never have to think
about the correct incantation again, and all my projects will
be on the same page with regards to correct utc timestamp.
I am yet again bumping into the limits of extract_table_column_map
as it does not use a real parser and does not recognize generated
columns, which causes issues when I use that column list to enforce
an insert.
It probably would be better to move even farther away from extracting
columns and just asking the database instead.
Anyway we get slightly improved ergonomics of insert_filler at the cost
of not being able to enforce all columns within this function.
For a while I was attracted to string IDs because of the notion
that "if you're not going to perform arithmetic, it shouldn't be
an int". But ints make way better use of the allotted bits and
I'm loving getrandbits for urandom ID generation.
This change has really made it easier to reason about database
transactions in my projects. When you use 'with db.transaction'
you know for sure that either the db will commit or rollback at
the end and you won't leave in a dirty state. And it will lock
out all other writers so nothing gets messed up.
Previously I was conflating atomicity of each function with
committing of the entire transaction, and that was causing me
grief. I think this is closer to correct.
If the project uses numerical IDs, and processes user input from a web
request URL where everything is a string, it is tedious to convert
between str and int on the application side. If done improperly, it
messes up the cache because the int id and str id will be entered
separately. So we let the database handle the id type and raise errors
if necessary.