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.
52 53 54 |
# File 'lib/sequel/extensions/null_dataset.rb', line 52 def columns @columns ||= db.dataset.clone(@opts).columns end |
#delete ⇒ Object
Return 0 without sending a database query.
57 58 59 |
# File 'lib/sequel/extensions/null_dataset.rb', line 57 def delete 0 end |
#each ⇒ Object
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 |
#insert ⇒ Object
Return nil without sending a database query.
72 73 74 |
# File 'lib/sequel/extensions/null_dataset.rb', line 72 def insert(*) nil end |
#truncate ⇒ Object
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 |