| 1 | #!/usr/bin/env perl | ||
| 2 | use DB::CouchDB::Schema::Edit; | ||
| 3 | use Getopt::Long; | ||
| 4 | use Pod::Usage; | ||
| 5 | |||
| 6 | my $editor = DB::CouchDB::Schema::Edit->new(); | ||
| 7 | |||
| 8 | #allow me to pas in my own connection info | ||
| 9 | |||
| 10 | my ($host,$port,$db); | ||
| 11 | |||
| 12 | my $opts = GetOptions ( | ||
| 13 | "host=s" => \$host, | ||
| 14 | "port=i" => \$port, | ||
| 15 | "db=s" => \$db | ||
| 16 | ); | ||
| 17 | |||
| 18 | if ($host && $db) { | ||
| 19 | my %dbargs = (host => $host); | ||
| 20 | $dbargs{port} = $port if $port; | ||
| 21 | $dbargs{db} = $db if $db; | ||
| 22 | $editor->schema(DB::CouchDB::Schema->new(%dbargs)); | ||
| 23 | } | ||
| 24 | |||
| 25 | $editor->run(); | ||
| 26 |