Changeset 80

Show
Ignore:
Timestamp:
01/22/08 19:05:32 (10 months ago)
Author:
larsivi
Message:

Added getLastInsertID override, but there is no implementation for now.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/dbi/pg/PgDatabase.d

    r70 r80  
    77version (dbi_pg) { 
    88 
    9  
    10 version (Phobos) { 
    11     private import std.string : toDString = toString, toCString = toStringz; 
    12     debug (UnitTest) private static import std.stdio; 
    13 } else { 
    14     private import tango.stdc.stringz : toDString = fromUtf8z, toCString = toUtf8z; 
     9    private import tango.stdc.stringz : toDString = fromUtf8z, toCString = toStringz; 
    1510    debug (UnitTest) private static import tango.io.Stdout; 
    1611} 
     
    207202    } 
    208203 
     204    /** 
     205     * Get the integer id of the last row to be inserted. 
     206     * 
     207     * Returns: 
     208     *  The id of the last row inserted into the database. 
     209     */ 
     210    override long getLastInsertID() { 
     211        // TODO: Somehow use PQoidValue with the last INSERT result 
     212        return 0; 
     213    } 
     214 
    209215    private: 
    210216    PGconn* connection; 
     
    213219 
    214220unittest { 
    215     version (Phobos) { 
    216         void s1 (char[] s) { 
    217             std.stdio.writefln("%s", s); 
    218         } 
    219  
    220         void s2 (char[] s) { 
    221             std.stdio.writefln("   ...%s", s); 
    222         } 
    223     } else { 
    224         void s1 (char[] s) { 
    225             tango.io.Stdout.Stdout(s).newline(); 
    226         } 
    227  
    228         void s2 (char[] s) { 
    229             tango.io.Stdout.Stdout("   ..." ~ s).newline(); 
    230         } 
    231     } 
     221    void s1 (char[] s) { 
     222        tango.io.Stdout.Stdout(s).newline(); 
     223    } 
     224 
     225    void s2 (char[] s) { 
     226        tango.io.Stdout.Stdout("   ..." ~ s).newline(); 
     227    } 
    232228 
    233229    s1("dbi.pg.PgDatabase:"); 
     
    276272    db.close(); 
    277273} 
    278 }