pg-format: type-aware SQL encoding

encode booleans, timestamps, escape strings, etc