module Wyrm

Dump a schema and compressed data from a db to a set of files

Dump["postgres://localhost:5454/lots", '/var/data/lots']

TODO possibly use Gem::Package::TarWriter to write tar files

TODO when restoring, could use a SizeQueue to make sure the db is kept busy TODO need to version the dumps, or something like that. TODO looks like io should belong to codec. Hmm. Not sure. TODO table_name table_dataset need some thinking about. Dataset would encapsulate both. But couldn't change db then, and primary_keys would be hard.

Load a schema from a set of dump files (from DumpSchema) and restore the table data.

Restore["postgres://localhost:5454/lots", '/var/data/lots']

TODO the problem with lazy loading the schema files is that errors in indexes and foreign keys will only be picked up at the end of they probably lengthy table restore process. TODO check if table has been restored already, and has the correct rows,

needs dst_db for mutate operations and src_db for fetch operations src_db must have extension(:schema_dumper)

Constants

STREAM_COMP
STREAM_DCMP
VERSION

Public Class Methods

sanity_check_dcmp() click to toggle source
# File lib/wyrm/cli.rb, line 4
def self.sanity_check_dcmp
  bzip_cmd = Wyrm::STREAM_DCMP.split(' ').first
  rv = `which #{bzip_cmd}`
  unless $?.exitstatus == 0
    puts "\n#{cmd} not installed or not in PATH"
    exit(1)
  end
end