How to obtain or query the description column of the table schema?
Currently:
si_table_name = params[:rid]
@si_field_names = Array.new
si_cols = ActiveRecord::Base.connection.columns(si_table_name, "#{name} Columns")
si_cols.each do |c|
@si_field_names << "#{c.name}:#{c.type}" <---------------
end
Goal: (this example doesn’t work… looking for the correct way to query this)
si_table_name = params[:rid]
@si_field_names = Array.new
si_cols = ActiveRecord::Base.connection.columns(si_table_name, "#{name} Columns")
si_cols.each do |c|
@si_field_names << "#{c.name}:#{c.type}:#{c.description}" <---------------
end
Not sure what you mean by ‘description’.
In any case, the table metadata can be queried using the information schema.
See
http://dev.mysql.com/doc/refman/5.6/en/columns-table.html
and in particular the table information_schema.columns, column COLUMN_COMMENT.