Module Sequel::Plugins::ColumnSelect
In: lib/sequel/plugins/column_select.rb

The column_select plugin changes the default selection for a model dataset to explicit select all columns from the table: table.column1, table.column2, table.column3, …. This makes it simpler to add columns to the model‘s table in a migration concurrently while running the application, without it affecting the operation of the application.

Note that by default on databases that supporting RETURNING, using explicit column selections will cause instance creations to use two queries (insert and refresh) instead of a single query using RETURNING. You can use the insert_returning_select plugin to automatically use RETURNING for instance creations for models where the column_select plugin automatically sets up an explicit column selection.

Usage:

  # Make all model subclasses explicitly select qualified columns
  Sequel::Model.plugin :column_select

  # Make the Album class select qualified columns
  Album.plugin :column_select

Methods

configure  

Classes and Modules

Module Sequel::Plugins::ColumnSelect::ClassMethods

Public Class methods

Modify the current model‘s dataset selection, if the model has a dataset.

[Source]

    # File lib/sequel/plugins/column_select.rb, line 28
28:       def self.configure(model)
29:         model.instance_eval do
30:           self.dataset = dataset if @dataset
31:         end
32:       end

[Validate]