Replace manual SQL generation with SerializedData
Use TIMESTAMPTZ instead of DATETIME