-
Notifications
You must be signed in to change notification settings - Fork 0
/
load_db
74 lines (49 loc) · 1.4 KB
/
load_db
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/usr/local/bin/perl
use strict;
use warnings;
use Morsulus::Ordinary::Classic;
use Getopt::Euclid;
my $ord = Morsulus::Ordinary::Classic->new(dbname => $ARGV{-db},
db_flat_file => $ARGV{-oanda} || '/dev/null',
category_file =>$ARGV{-init} || '/dev/null',
);
if (defined $ARGV{-init})
{
$ord->makeDB;
}
elsif (defined $ARGV{-oanda})
{
$ord->load_database;
}
__END__
=head1 NAME
load_db - script to create database files
=head1 SYNOPSIS
load_db -db mydb.db -oanda oanda.db # load existing database
load_db -db newdb.db -init my.cat -oanda oanda.db # make new database
Optionally creates and then loads ordinary data into a database.
Note that loading up the whole O and A may take some time, and the
process gives no clear signs of progress. On the other hand, you can
open the db file with sqlite3 and monitor the number of rows in the
table "registrations". You do have SQLite installed as a standalone
tool, right?
=head1 REQUIRED
=over
=item -db <file>
SQLite database file to be created or updated with Ordinary entries.
=for Euclid:
file.type: writable
=back
=head1 OPTIONS
=over
=item -init <catfile>
Initializes new database and loads the specified category file.
=for Euclid:
catfile.type: readable
catfile.default: undef
=item -oanda <file>
Legacy format flat file database to load from.
=for Euclid:
file.type: readable
file.default: undef
=back