koha-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Koha-devel] SQL Dtabase Flavour Alternate Routines and Identifier Q


From: Thomas D
Subject: Re: [Koha-devel] SQL Dtabase Flavour Alternate Routines and Identifier Quoting Proposal
Date: Sat, 04 Feb 2006 08:42:05 +0100

Oops, I left out an enclosing if clause for one part of the code at the end
of this section.  This is one thing need to prevent failure in the present
usual case where db_scheme may not be included in the koha.conf.

# At the top of any C4 modules or $KOHA/admin/ 
# scripts requiring SQL database access:
# Obtain a value for the SQL database implementation type (flavour)
my $sqlDBType = C4::Context->config("sqlDBType");
my $nonMySQLDBType = $sqlDBType;
if ($nonMySQLDBType) {
    if ($nonMySQLDBType =~ /mysql/i) {$nonMySQLDBType = undef;}
}


Thomas D


Quoting Thomas D <address@hidden> :
> ---------------- Beginning of the original message ------------------
> 

[snip]

> PROPOSED CODE FOR GUIDELINE
> 
> # Modification for Context.pm
>         # Quick hack for allowing databases name in full text
>         # from authorised value list
>         if ( $1 eq "db_scheme" ) {
>             $retval{sqlDBType} = $2; # add virtual config
> variable
>             $value = db_scheme2dbi($2);
>         } else {
>             $value = $2;
>         }
>         $retval->{$1} = $value;
> 
> 
> 
> # At the top of any C4 modules or $KOHA/admin/ 
> # scripts requiring SQL database access:
> # Obtain a value for the SQL database implementation type
> (flavour)
> $my $sqlDBType = C4::Context->config("sqlDBType");
> my $nonMySQLDBType = $sqlDBType;
> if ($nonMySQLDBType =~ /mysql/i) {$nonMySQLDBType = undef;}
> 
> 
> # Alternate routines or routine placeholders for various SQL
> database types
> if ($nonMySQLDBType) {
> 
>     if ($nonMySQLDBType eq 'postgres7') {
>         # Postgres 7 specific code
>     } elsif ($nonMySQLDBType eq 'postgres8') {
>         # Postgres 8 specific code
>     } elsif ($nonMySQLDBType eq 'oracle') {
>         # Oracle specific code
>     } else {
>         # ANSI code
>     }
> 
> } else {
>     # MySQL specific code
> }
> 
> 

[snip]

---------------------------------------------
Alinto wishes you a happy new year 2006 http://www.alinto.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]