Bugfix: invalid SQL results in type error
Allow for REPLACE queries