Class: SQLStatement::Function

Inherits:
String show all
Defined in:
lib/sql/statement.rb

Overview

This class is used to represent complex SQL expressions, so that queries can return expressions. This is also meant to be used for conditions in a WHERE clause. There are no utility classes for generating these (even though they’ll probably include field names and other kinds of values), but for convenience, they can be generated with SQLHelpers#string_func.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from String

#dbid

Constructor Details

#initialize(val = "", placeheld = []) ⇒ Function

Returns a new instance of Function.



74
75
76
77
# File 'lib/sql/statement.rb', line 74

def initialize(val="",placeheld=[])
   super val
   @placeheld=placeheld
end

Instance Attribute Details

#placeheldObject

you need to manually keep this list of values for placeholders in sync with the actual string contained in this expression.



81
82
83
# File 'lib/sql/statement.rb', line 81

def placeheld
  @placeheld
end

Instance Method Details

#to_sqlpartObject



83
84
85
# File 'lib/sql/statement.rb', line 83

def to_sqlpart
   self
end