Handle PKs of integral types other than int64

(Presently QBS thinks non-int64 PKs are always zero, which leads to them not being used.)

All MySQL tests pass.