Changeset 41

Show
Ignore:
Timestamp:
01/05/07 15:35:54 (2 years ago)
Author:
brad
Message:
  • renamed libddbi.a because my linux box already had libdbi.a - not sure what it is...
  • ignore the .svn folders if this is a Subversion working copy
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/buildme.d

    r40 r41  
    7777            switchesCompiler["-ofdbi.lib"] = true; 
    7878        } else { 
    79             switchesCompiler["-oflibdbi.a"] = true; 
     79            switchesCompiler["-odlibddbi.a"] = true; 
    8080        } 
    8181        version (Ares) { 
     
    9595            switchesCompiler["-o dbi.lib"] = true; 
    9696        } else { 
    97             switchesCompiler["-o libdbi.a"] = true; 
     97            switchesCompiler["-o libddbi.a"] = true; 
    9898        } 
    9999        version (Ares) { 
     
    121121        chdir("dbi"); 
    122122        foreach (char[] dir; listdir(getcwd())) { 
    123             if (isdir(dir)) { 
     123            if (isdir(dir) && dir != ".svn") { 
    124124                allList[dir] = true; 
    125125            } 
  • trunk/dbi/pg/PgDatabase.d

    r40 r41  
    88module dbi.pg.PgDatabase; 
    99 
    10 version (Ares) { 
    11     private import util.string : asString = toString; 
     10version (Tango) { 
     11    private import tango.stdc.stringz : toDString = fromUtf8z; 
     12    private import tango.stdc.stringz : toCString = toUtf8z; 
    1213    debug (UnitTest) private import std.io.Console; 
    1314} else { 
    14     private import std.string : asString = toString; 
     15    private import std.string : toDString = toString; 
     16    private import std.string : toCString = toStringz; 
    1517    debug (UnitTest) private import std.stdio; 
    1618} 
     
    103105            params ~= " password=" ~ password ~ ""; 
    104106        } 
    105         connection = PQconnectdb(params); 
     107        connection = PQconnectdb(toCString(params)); 
    106108        m_errorCode = cast(int)PQstatus(connection); 
    107109        if (m_errorCode != ConnStatusType.CONNECTION_OK && m_errorCode) { 
    108             throw new DBIException(asString(PQerrorMessage(connection)), m_errorCode); 
     110            throw new DBIException(toDString(PQerrorMessage(connection)), m_errorCode); 
    109111        } 
    110112    } 
     
    130132     */ 
    131133    override void execute (char[] sql) { 
    132         PGresult* res = PQexec(connection, sql.dup); 
     134        PGresult* res = PQexec(connection, toCString(sql.dup)); 
    133135        scope(exit) PQclear(res); 
    134136        m_errorCode = cast(int)PQresultStatus(res); 
    135137        if (m_errorCode != ExecStatusType.PGRES_COMMAND_OK && m_errorCode != ExecStatusType.PGRES_TUPLES_OK) { 
    136             throw new DBIException(asString(PQerrorMessage(connection)), m_errorCode, specificToGeneral(PQresultErrorField(res, PG_DIAG_SQLSTATE))); 
     138            throw new DBIException(toDString(PQerrorMessage(connection)), m_errorCode, specificToGeneral(PQresultErrorField(res, PG_DIAG_SQLSTATE))); 
    137139        } 
    138140    } 
     
    151153     */ 
    152154    override PgResult query (char[] sql) { 
    153         PGresult* res = PQexec(connection, sql.dup); 
     155        PGresult* res = PQexec(connection, toCString(sql.dup)); 
    154156        ExecStatusType status = PQresultStatus(res); 
    155157        m_errorCode = cast(int)PQresultStatus(res); 
    156158        if (m_errorCode != ExecStatusType.PGRES_COMMAND_OK && m_errorCode != ExecStatusType.PGRES_TUPLES_OK) { 
    157             throw new DBIException(asString(PQerrorMessage(connection)), m_errorCode, specificToGeneral(PQresultErrorField(res, PG_DIAG_SQLSTATE))); 
     159            throw new DBIException(toDString(PQerrorMessage(connection)), m_errorCode, specificToGeneral(PQresultErrorField(res, PG_DIAG_SQLSTATE))); 
    158160        } 
    159161        return new PgResult(res); 
     
    195197 
    196198unittest { 
    197     version (Ares) { 
     199    version (Tango) { 
    198200        void s1 (char[] s) { 
    199201            Cout("" ~ s ~ "\n"); 
  • trunk/dbi/pg/PgResult.d

    r40 r41  
    4444        } 
    4545 
    46         if (index > numRows) { 
     46        if (index >= numRows) { 
    4747            return null; 
    4848        } 
  • trunk/dbi/pg/all.d

    r40 r41  
    1414public import   dbi.pg.PgDatabase, 
    1515        dbi.pg.PgResult, 
     16        dbi.pg.PgError, 
    1617        dbi.all; 
  • trunk/dbi/pg/imp.d

    r40 r41  
    2020    pragma (lib, "libpq.lib"); 
    2121} else version (linux) { 
     22    pragma (lib, "libpq.a"); 
     23} else version (Posix) { 
    2224    pragma (lib, "libpq.a"); 
    2325} else version (darwin) {