module Sequel::SchemaCaching

  1. lib/sequel/extensions/schema_caching.rb
Parent: Sequel

Public Instance methods

dump_schema_cache (file)

Dump the cached schema to the filename given in Marshal format.

[show source]
# File lib/sequel/extensions/schema_caching.rb, line 48
def dump_schema_cache(file)
  File.open(file, 'wb'){|f| f.write(Marshal.dump(@schemas))}
  nil
end
dump_schema_cache? (file)

Dump the cached schema to the filename given unless the file already exists.

[show source]
# File lib/sequel/extensions/schema_caching.rb, line 55
def dump_schema_cache?(file)
  dump_schema_cache(file) unless File.exist?(file)
end
load_schema_cache (file)

Replace the schema cache with the data from the given file, which should be in Marshal format.

[show source]
# File lib/sequel/extensions/schema_caching.rb, line 61
def load_schema_cache(file)
  @schemas = Marshal.load(File.read(file))
  nil
end
load_schema_cache? (file)

Replace the schema cache with the data from the given file if the file exists.

[show source]
# File lib/sequel/extensions/schema_caching.rb, line 68
def load_schema_cache?(file)
  load_schema_cache(file) if File.exist?(file)
end