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.


51
52
53
54
55
56
# File 'lib/sequel/extensions/null_dataset.rb', line 51

def columns
  if cols = _columns
    return cols
  end
  self.columns = db.dataset.clone(@opts).columns
end

#deleteObject

Return 0 without sending a database query.


59
60
61
# File 'lib/sequel/extensions/null_dataset.rb', line 59

def delete
  0
end

#eachObject

Return self without sending a database query, never yielding.


64
65
66
# File 'lib/sequel/extensions/null_dataset.rb', line 64

def each
  self
end

#fetch_rows(sql) ⇒ Object

Return nil without sending a database query, never yielding.


69
70
71
# File 'lib/sequel/extensions/null_dataset.rb', line 69

def fetch_rows(sql)
  nil
end

#insertObject

Return nil without sending a database query.


74
75
76
# File 'lib/sequel/extensions/null_dataset.rb', line 74

def insert(*)
  nil
end

#truncateObject

Return nil without sending a database query.


79
80
81
# File 'lib/sequel/extensions/null_dataset.rb', line 79

def truncate
  nil
end

#update(v = OPTS) ⇒ Object

Return 0 without sending a database query.


84
85
86
# File 'lib/sequel/extensions/null_dataset.rb', line 84

def update(v=OPTS)
  0
end