Module: Sequel::Dataset::NullDataset

Defined in:
lib/sequel/extensions/null_dataset.rb

Instance Method Summary collapse

Instance Method Details

#columnsObject

Create a new dataset from the dataset (which won’t be nulled) to get the columns if they aren’t already cached.



56
57
58
# File 'lib/sequel/extensions/null_dataset.rb', line 56

def columns
  @columns ||= db.dataset.clone(@opts).columns
end

#deleteObject

Return 0 without sending a database query.



61
62
63
# File 'lib/sequel/extensions/null_dataset.rb', line 61

def delete
  0
end

#eachObject

Return self without sending a database query, never yielding.



66
67
68
# File 'lib/sequel/extensions/null_dataset.rb', line 66

def each
  self
end

#fetch_rows(sql) ⇒ Object

Return nil without sending a database query, never yielding.



71
72
73
# File 'lib/sequel/extensions/null_dataset.rb', line 71

def fetch_rows(sql)
  nil
end

#insertObject

Return nil without sending a database query.



76
77
78
# File 'lib/sequel/extensions/null_dataset.rb', line 76

def insert(*)
  nil
end

#truncateObject

Return nil without sending a database query.



81
82
83
# File 'lib/sequel/extensions/null_dataset.rb', line 81

def truncate
  nil
end

#update(v = OPTS) ⇒ Object

Return 0 without sending a database query.



86
87
88
# File 'lib/sequel/extensions/null_dataset.rb', line 86

def update(v=OPTS)
  0
end