columns_introspection.rb

lib/sequel/extensions/columns_introspection.rb
Last Update: 2011-04-13 16:34:15 -0700

The columns_introspection extension attempts to introspect the selected columns for a dataset before issuing a query. If it thinks it can guess correctly at the columns the query will use, it will return the columns without issuing a database query. This method is not fool-proof, it's possible that some databases will use column names that Sequel does not expect.

To enable this for a single dataset, extend the dataset with Sequel::ColumnIntrospection. To enable this for all datasets, run:

Sequel::Dataset.introspect_all_columns