Class: Symbol
Overview
Symbols are used for representing table names and field names, and aliases for these. They correctly expand into SQL so as not to cause syntax errors, even if the symbol happens to be the same as a reserved word in SQL.
Instance Method Summary collapse
-
#[](column) ⇒ Object
Create an SQL_Field object referencing the column
column
in the table named by this symbol. -
#dbid ⇒ Object
Returns a SQLStatement::Identifier for this Symbol.
- #placeheld ⇒ Object
- #to_sqlpart ⇒ Object
Instance Method Details
#[](column) ⇒ Object
Create an SQL_Field object referencing the column column
in the table named by this symbol.
39 40 41 |
# File 'lib/sql/statement.rb', line 39 def [](column) SQLStatement::SQL_Field.new(self,column) end |
#dbid ⇒ Object
Returns a SQLStatement::Identifier for this Symbol
501 502 503 |
# File 'lib/sql/statement.rb', line 501 def dbid SQLStatement::Identifier.new(to_s) end |
#placeheld ⇒ Object
35 |
# File 'lib/sql/statement.rb', line 35 def placeheld; []; end |
#to_sqlpart ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/sql/statement.rb', line 27 def to_sqlpart if self==:* to_s else "`"+to_s+"`" end end |