class Sequel::Mock::Dataset

Constants

DatasetClass

Public Instance Methods

_fetch() click to toggle source

The fetch setting for this dataset, if it has been overridden

# File lib/sequel/adapters/mock.rb, line 328
def _fetch
  cache_get(:_fetch) || @opts[:fetch]
end
_fetch=(v) click to toggle source

Override the databases’s fetch setting for this dataset

# File lib/sequel/adapters/mock.rb, line 333
def _fetch=(v)
  cache_set(:_fetch, nil)
  @opts[:fetch] = v
end
autoid() click to toggle source

The autoid setting for this dataset, if it has been overridden

# File lib/sequel/adapters/mock.rb, line 317
def autoid
  cache_get(:_autoid) || @opts[:autoid]
end
autoid=(v) click to toggle source

Override the databases’s autoid setting for this dataset

# File lib/sequel/adapters/mock.rb, line 322
def autoid=(v)
  cache_set(:_autoid, nil)
  @opts[:autoid] = v
end
columns(*cs) click to toggle source

If arguments are provided, use them to set the columns for this dataset and return self. Otherwise, use the default Sequel behavior and return the columns.

# File lib/sequel/adapters/mock.rb, line 352
def columns(*cs)
  if cs.empty?
    super
  else
    self.columns = cs
    self
  end
end
fetch_rows(sql, &block) click to toggle source
# File lib/sequel/adapters/mock.rb, line 361
def fetch_rows(sql, &block)
  execute(sql, &block)
end
numrows() click to toggle source

The numrows setting for this dataset, if it has been overridden

# File lib/sequel/adapters/mock.rb, line 339
def numrows
  cache_get(:_numrows) || @opts[:numrows]
end
numrows=(v) click to toggle source

Override the databases’s numrows setting for this dataset

# File lib/sequel/adapters/mock.rb, line 344
def numrows=(v)
  cache_set(:_numrows, nil)
  @opts[:numrows] = v
end
quote_identifiers?() click to toggle source
# File lib/sequel/adapters/mock.rb, line 365
def quote_identifiers?
  @opts.fetch(:quote_identifiers, db.send(:quote_identifiers_default))
end
with_autoid(autoid) click to toggle source

Return cloned dataset with the autoid setting modified

# File lib/sequel/adapters/mock.rb, line 370
def with_autoid(autoid)
  clone(:autoid=>autoid)
end
with_fetch(fetch) click to toggle source

Return cloned dataset with the fetch setting modified

# File lib/sequel/adapters/mock.rb, line 375
def with_fetch(fetch)
  clone(:fetch=>fetch)
end
with_numrows(numrows) click to toggle source

Return cloned dataset with the numrows setting modified

# File lib/sequel/adapters/mock.rb, line 380
def with_numrows(numrows)
  clone(:numrows=>numrows)
end