Module: Sequel::Dataset::NullDataset
- Defined in:
- lib/sequel/extensions/null_dataset.rb
Instance Method Summary collapse
-
#columns ⇒ Object
Create a new dataset from the dataset (which won’t be nulled) to get the columns if they aren’t already cached.
-
#delete ⇒ Object
Return 0 without sending a database query.
-
#each ⇒ Object
Return self without sending a database query, never yielding.
-
#fetch_rows(sql) ⇒ Object
Return nil without sending a database query, never yielding.
-
#insert ⇒ Object
Return nil without sending a database query.
-
#truncate ⇒ Object
Return nil without sending a database query.
-
#update(v = OPTS) ⇒ Object
Return 0 without sending a database query.
Instance Method Details
#columns ⇒ Object
Create a new dataset from the dataset (which won’t be nulled) to get the columns if they aren’t already cached.
53 54 55 56 57 58 |
# File 'lib/sequel/extensions/null_dataset.rb', line 53 def columns if cols = _columns return cols end self.columns = db.dataset.clone(@opts).columns end |
#delete ⇒ Object
Return 0 without sending a database query.
61 62 63 |
# File 'lib/sequel/extensions/null_dataset.rb', line 61 def delete 0 end |
#each ⇒ Object
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 |
#insert ⇒ Object
Return nil without sending a database query.
76 77 78 |
# File 'lib/sequel/extensions/null_dataset.rb', line 76 def insert(*) nil end |
#truncate ⇒ Object
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 |