projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add NET::CIDR::Lite to the list of dependences
[spider.git]
/
perl
/
DXSql
/
SQLite.pm
diff --git
a/perl/DXSql/SQLite.pm
b/perl/DXSql/SQLite.pm
index 9819dbd0ff330a1eff6184c9e6866a529c4c5efc..36bcc46da72554ae53721a85b147f8f6868b0e6b 100644
(file)
--- a/
perl/DXSql/SQLite.pm
+++ b/
perl/DXSql/SQLite.pm
@@
-3,7
+3,7
@@
#
# Stuff like table creates and (later) alters
#
#
# Stuff like table creates and (later) alters
#
-#
$Id$
+#
#
# Copyright (c) 2005 Dirk Koopman G1TLH
#
#
# Copyright (c) 2005 Dirk Koopman G1TLH
#
@@
-22,11
+22,36
@@
sub show_tables
my $sth = $self->prepare($s);
$sth->execute;
my @out;
my $sth = $self->prepare($s);
$sth->execute;
my @out;
- push @out, $sth->fetchrow_array;
+ while (my @t = $sth->fetchrow_array) {
+ push @out, @t;
+ }
$sth->finish;
return @out;
}
$sth->finish;
return @out;
}
+sub has_ipaddr
+{
+ my $self = shift;
+ my $s = q(PRAGMA table_info(spot));
+ my $sth = $self->prepare($s);
+ $sth->execute;
+ while (my @t = $sth->fetchrow_array) {
+ if ($t[1] eq 'ipaddr') {
+ $sth->finish;
+ return 1;
+ }
+ }
+ $sth->finish;
+ return undef;
+}
+
+sub add_ipaddr
+{
+ my $self = shift;
+ my $s = q(alter table spot add column ipaddr text);
+ $self->do($s);
+}
+
sub spot_create_table
{
my $self = shift;
sub spot_create_table
{
my $self = shift;
@@
-45,7
+70,8
@@
spotcq int,
spotteritu int,
spottercq int,
spotstate text,
spotteritu int,
spottercq int,
spotstate text,
-spotterstate text
+spotterstate text,
+ipaddr text
)};
$self->do($s);
}
)};
$self->do($s);
}
@@
-53,10
+79,14
@@
spotterstate text
sub spot_add_indexes
{
my $self = shift;
sub spot_add_indexes
{
my $self = shift;
- $self->do('create index spot_ix1 on spot(time desc)');
dbg('adding spot index ix1');
dbg('adding spot index ix1');
- $self->do('create index spot_ix
2 on spot(spotcall
asc)');
+ $self->do('create index spot_ix
1 on spot(time
asc)');
dbg('adding spot index ix2');
dbg('adding spot index ix2');
+ $self->do('create index spot_ix2 on spot(spotcall asc)');
+ dbg('adding spot index ix3');
+ $self->do('create index spot_ix3 on spot(freq asc)');
+ dbg('adding spot index ix4');
+ $self->do('create index spot_ix4 on spot(spotter asc)');
}
}