Module | Sequel::SchemaCaching |
In: |
lib/sequel/extensions/schema_caching.rb
|
Dump the cached schema to the filename given in Marshal format.
# File lib/sequel/extensions/schema_caching.rb, line 49 49: def dump_schema_cache(file) 50: File.open(file, 'wb'){|f| f.write(Marshal.dump(@schemas))} 51: nil 52: end
Dump the cached schema to the filename given unless the file already exists.
# File lib/sequel/extensions/schema_caching.rb, line 56 56: def dump_schema_cache?(file) 57: dump_schema_cache(file) unless File.exist?(file) 58: end
Replace the schema cache with the data from the given file, which should be in Marshal format.
# File lib/sequel/extensions/schema_caching.rb, line 62 62: def load_schema_cache(file) 63: @schemas = Marshal.load(File.read(file)) 64: nil 65: end