Project

General

Profile

Actions

Task #450

open

cast all untyped literals as text using cast_literal()

Added by Aaron Marcuse-Kubitza over 11 years ago.

Status:
New
Priority:
Normal
Start date:
07/30/2012
Due date:
% Done:

0%

Estimated time:
Activity type:

Description

  • but need to deal with SQL function _nullIf() param type mismatch

sql_gen.py code to use:

class RawLiteral(Code):
    def __init__(self, value):
        Code.__init__(self)

        self.value = value

    def to_str(self, db): return db.esc_value(self.value)

class Literal(RawLiteral):
    def to_str(self, db):
        if util.is_str(self.value): # avoid text literals having type `unknown`
            return Cast('text', RawLiteral(self.value)).to_str(db)
        return RawLiteral.to_str(self, db)

No data to display

Actions

Also available in: Atom PDF