Class: Symbol

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

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

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

#dbidObject

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

#placeheldObject



35
# File 'lib/sql/statement.rb', line 35

def placeheld; []; end

#to_sqlpartObject



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