X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXSql%2Fmysql.pm;fp=perl%2FDXSql%2Fmysql.pm;h=5197adb1e454eeac7db1794c98867959809cdbc7;hb=917f7586cf60e96e07233c72b9854d754638f253;hp=0000000000000000000000000000000000000000;hpb=70fdef0395640e4bfcfef08bc9a59d3a6b1f7bd9;p=spider.git diff --git a/perl/DXSql/mysql.pm b/perl/DXSql/mysql.pm new file mode 100644 index 00000000..5197adb1 --- /dev/null +++ b/perl/DXSql/mysql.pm @@ -0,0 +1,68 @@ +# +# Module for SQLite DXSql variants +# +# Stuff like table creates and (later) alters +# +# $Id$ +# +# Copyright (c) 2005 Dirk Koopman G1TLH +# + +package DXSql::mysql; + +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)); +$main::build += $VERSION; +$main::branch += $BRANCH; + +@ISA = qw{DXSql}; + +sub show_tables +{ + my $self = shift; + my $s = q(show tables); + 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 auto_increment primary key , +freq real not null, +spotcall varchar(14) not null, +time int not null, +comment varchar(255), +spotter varchar(14) not null, +spotdxcc smallint, +spotterdxcc smallint, +origin varchar(14), +spotitu tinyint, +spotcq tinyint, +spotteritu tinyint, +spottercq tinyint, +spotstate char(2), +spotterstate char(2) +)}; + $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;