X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXSql%2FSQLite.pm;h=9447505a56795f6536bd90f9865cd9736db1fc3f;hb=917f7586cf60e96e07233c72b9854d754638f253;hp=2f62461cdb0b2394d8180d8ff33745390e4d29d6;hpb=70fdef0395640e4bfcfef08bc9a59d3a6b1f7bd9;p=spider.git diff --git a/perl/DXSql/SQLite.pm b/perl/DXSql/SQLite.pm index 2f62461c..9447505a 100644 --- a/perl/DXSql/SQLite.pm +++ b/perl/DXSql/SQLite.pm @@ -10,6 +10,8 @@ package DXSql::SQLite; +use DXDebug; + use vars qw($VERSION $BRANCH @ISA); $VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ ); $BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ || (0,0)); @@ -18,4 +20,49 @@ $main::branch += $BRANCH; @ISA = qw{DXSql}; +sub show_tables +{ + my $self = shift; + my $s = q(SELECT name FROM sqlite_master WHERE type='table' ORDER BY name); + my $sth = $self->prepare($s); + $sth->execute; + my @out; + push @out, $sth->fetchrow_array; + $sth->finish; + return @out; +} + +sub spot_create_table +{ + my $self = shift; + my $s = q{create table spot ( +rowid integer primary key, +freq real not null, +spotcall text not null, +time int not null, +comment text, +spotter text not null, +spotdxcc int, +spotterdxcc int, +origin text, +spotitu int, +spotcq int, +spotteritu int, +spottercq int, +spotstate text, +spotterstate text +)}; + $self->do($s); +} + +sub spot_add_indexes +{ + my $self = shift; + $self->do('create index spot_ix1 on spot(time desc)'); + dbg('adding spot index ix1'); + $self->do('create index spot_ix2 on spot(spotcall asc)'); + dbg('adding spot index ix2'); +} + + 1;