Class: XMigra::MSSQLSpecifics::StatisticsObject
- Defined in:
- lib/xmigra/db_support/mssql.rb
Instance Attribute Summary collapse
-
#columns ⇒ Object
readonly
Returns the value of attribute columns.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Instance Method Summary collapse
- #creation_sql ⇒ Object
-
#initialize(name, params) ⇒ StatisticsObject
constructor
A new instance of StatisticsObject.
Constructor Details
#initialize(name, params) ⇒ StatisticsObject
Returns a new instance of StatisticsObject.
19 20 21 22 23 24 25 26 |
# File 'lib/xmigra/db_support/mssql.rb', line 19 def initialize(name, params) (@name = name.dup).freeze (@target = params[0].dup).freeze (@columns = params[1].dup).freeze @options = params[2] || {} @options.freeze @options.each_value {|v| v.freeze} end |
Instance Attribute Details
#columns ⇒ Object (readonly)
Returns the value of attribute columns.
28 29 30 |
# File 'lib/xmigra/db_support/mssql.rb', line 28 def columns @columns end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
28 29 30 |
# File 'lib/xmigra/db_support/mssql.rb', line 28 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
28 29 30 |
# File 'lib/xmigra/db_support/mssql.rb', line 28 def @options end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
28 29 30 |
# File 'lib/xmigra/db_support/mssql.rb', line 28 def target @target end |
Instance Method Details
#creation_sql ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'lib/xmigra/db_support/mssql.rb', line 30 def creation_sql result = "CREATE STATISTICS #{name} ON #{target} (#{columns})" result += " WHERE " + @options['where'] if @options['where'] result += " WITH " + @options['with'] if @options['with'] result += ";" return result end |