Comment 0 for bug 143776

Revision history for this message
José Henrique Reis (jhreis) wrote :

Uploaded: sqltest.pat

Some time ago Dieter Maurer changed the sqlvar behaviour to map Python None to SQL NULL for all types (issue 556). I think that sqltest should have the same behavior, so parameters explicitly passed as None are mapped to SQL null.

This would bring consistency between sqlvar and sqltest and would allow to greater flexibility in the construction of zsql methods, like in this example:

update table
set <dtml-sqlgroup>
  <dtml-sqltest abc type="nb" optional><dtml-comma>
  <dtml-sqltest dof type="nb" optional>
</dtml-sqlgroup>
where ghi = <dtml-sqlvar ghi type="nb">

if called with 'abc="123", ghi="789 this would result in:

update table
set (abc = '123', dof = null)
where ghi = '789'