Project

General

Profile

« Previous | Next » 

Revision 6300

sql_io.py: cast(): Use sql_gen.Cast() to generate the cast, in order to take advantage of its support for casts to unknown

View differences:

sql_io.py
152 152
/* The explicit cast to the return type is needed to make the cast happen
153 153
inside the try block. (Implicit casts to the return type happen at the end
154 154
of the function, outside any block.) */
155
RETURN value::'''+type_+''';
155
RETURN '''+sql_gen.Cast(type_, sql_gen.CustomCode('value')).to_str(db)+''';
156 156
'''))
157 157
    body.lang='plpgsql'
158 158
    sql.define_func(db, sql_gen.FunctionDef(function, type_, body,

Also available in: Unified diff