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.



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

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

#deleteObject

Return 0 without sending a database query.



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

def delete
  0
end

#eachObject

Return self without sending a database query, never yielding.



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

def each
  self
end

#fetch_rows(sql) ⇒ Object

Return nil without sending a database query, never yielding.



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

def fetch_rows(sql)
  nil
end

#insertObject

Return nil without sending a database query.



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

def insert(*)
  nil
end

#truncateObject

Return nil without sending a database query.



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

def truncate
  nil
end

#update(v = OPTS) ⇒ Object

Return 0 without sending a database query.



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

def update(v=OPTS)
  0
end