G::DB GDBAPI
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Summary
G::DB::GDBAPI
Package variables
Privates (from "my" definitions)
$reservedwords = "add all alter analyze and as asc asensitive auto_increment bdb before berkeleydb between bigint binary blob both by call cascade case change char character check collate column columns condition connection constraint continue create cross current_date current_time current_timestamp cursor database databases day_hour day_microsecond day_minute day_second dec decimal declare default delayed delete desc describe deterministic distinct distinctrow div double drop else elseif enclosed escaped exists exit explain false fetch fields float for force foreign found frac_second from fulltext grant group having high_priority hour_microsecond hour_minute hour_second if ignore in index infile inner innodb inout insensitive insert int integer interval into io_thread is iterate join key keys kill leading leave left like limit lines load localtime localtimestamp lock long longblob longtext loop low_priority master_server_id match mediumblob mediumint mediumtext middleint minute_microsecond minute_second mod natural not no_write_to_binlog null numeric on optimize option optionally or order out outer outfile precision primary privileges procedure purge read real references regexp rename repeat replace require restrict return revoke right rlike second_microsecond select sensitive separator set show smallint some soname spatial specific sql sqlexception sqlstate sqlwarning sql_big_result sql_calc_found_rows sql_small_result sql_tsi_day sql_tsi_frac_second sql_tsi_hour sql_tsi_minute sql_tsi_month sql_tsi_quarter sql_tsi_second sql_tsi_week sql_tsi_year ssl starting straight_join striped table tables terminated then timestampadd timestampdiff tinyblob tinyint tinytext to trailing true undo union unique unlock unsigned update usage use user_resources using utc_date utc_time utc_timestamp values varbinary varchar varcharacter varying when where while with write xor year_month zerofill action bit date enum no text time timestamp"
Inherit
Unavailable
Synopsis
 use G::DB::GDBAPI;
 @ISA = (G::DB::GDBAPI);
Description
 Intended for internal use only. Super class for the core. Provides 
 the native methods.
Methods
cols
No description
Code
rows
No description
Code
rows_old
No description
Code
select
No description
Code
set_cols
No description
Code
Methods description
None available.
Methods code
colsdescriptionprevnextTop
sub cols {
    my $this = shift;
    $this->set_cols() unless(length $this->{COLS});

    return(split(/\t:\t/, $this->{COLS}));
}
rowsdescriptionprevnextTop
sub rows {
    my $this = shift;
    my $all = shift;
    my @rows;

    foreach my $key (sort {$a <=> $b} keys %{$this}){
	next if ($key eq 'COLS' || $key eq 'SQL' || $key eq 'QUERY');
	if($all ne 'all'){
	    next if ($this->{$key}->{on} eq "0");
	}
        push (@rows, $key);
    }

    return @rows;
}
rows_olddescriptionprevnextTop
sub rows_old {
    my $this = shift;
    my $all = shift;
    my $i = 0;
    my @rows;

    while(defined(%{$this->{$i}})){
	if($all ne 'all'){
	    if ($this->{$i}->{on} eq "0"){
		$i ++;
		next;
	    }
	}
        push (@rows, "$i");
        $i ++;
    }

    return @rows;
}
selectdescriptionprevnextTop
sub select {
    my $this = shift;

    my $arg = shift;
    my ($arg1, $arg2, $arg3) = split(/\s+/, $arg, 3);

    my @res = ();

    if ($arg2 eq 'eq'){
	foreach my $row ($this->rows()){
	    if ($this->{$row}->{$arg1} eq $arg3){
		push(@res, $row);
	    }
	}
    }else{
	foreach my $row ($this->rows()){
	    if ($this->{$row}->{$arg1} =~ /$arg3/){
		push(@res, $row);
	    }
	}
    }
}
set_colsdescriptionprevnextTop
sub set_cols {
    my $this = shift;
    my %hash;

    foreach my $row ($this->rows("all")){
	foreach my $col (keys %{$this->{$row}}){
	    next if ($col eq "on");
	    $hash{$col} ++;
	}
    }

    foreach my $key (keys %hash){
	my $lckey = lc($key);

	if($reservedwords =~ /\s$lckey\s/){
	    die("  Error: $key is a reserved word in SQL.\n");
	}
    }

    $this->{COLS} = join("\t:\t", keys %hash);
}
General documentation
AUTHORTop
Kazuharu Arakawa, gaou@sfc.keio.ac.jp
SEE ALSOTop
perl(1).