Class: Mkxms::Mssql::TableHandler

Inherits:
Object
  • Object
show all
Includes:
PropertyHandler::ElementHandler
Defined in:
lib/mkxms/mssql/table_handler.rb

Defined Under Namespace

Classes: ColumnHandler

Instance Method Summary collapse

Methods included from PropertyHandler::ElementHandler

#handle_property_element

Constructor Details

#initialize(tables, node) ⇒ TableHandler

Returns a new instance of TableHandler.



153
154
155
156
157
158
159
160
161
162
163
164
# File 'lib/mkxms/mssql/table_handler.rb', line 153

def initialize(tables, node)
  a = node.attributes
  @table = Table.new(a['schema'], a['name']).tap do |t|
    store_properties_on t
    tables << t
  end
  @table.owner = a['owner']
  @table.heap_storage = a['rows-on']
  @table.lob_storage = a['textimage-on']
  @identity_column = a['identity']
  @rowguid_column = a['rowguidcol']
end

Instance Method Details

#handle_column_element(parse) ⇒ Object



166
167
168
169
170
171
172
# File 'lib/mkxms/mssql/table_handler.rb', line 166

def handle_column_element(parse)
  parse.context = ColumnHandler.new(@table.columns, parse.node)
  column = parse.context.column
  
  column.flags << :identity if column.name.eql? @identity_column
  column.flags << :rowguid if column.name.eql? @rowguid_column
end