Changeset 70

Show
Ignore:
Timestamp:
09/05/07 18:16:15 (1 year ago)
Author:
stonecobra
Message:

big change: consistent license headers, removed version info, added version statements for compilation

Files:

Legend:

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

    r63 r70  
    2828 * 
    2929 * Authors: The D DBI project 
    30  * 
    31  * Version: 0.2.5 
    32  * 
    3330 * Copyright: BSD license 
    3431 */ 
  • trunk/dbi/DBIException.d

    r59 r70  
    11/** 
    22 * Authors: The D DBI project 
    3  * 
    4  * Version: 0.2.5 
    5  * 
    63 * Copyright: BSD license 
    74 */ 
  • trunk/dbi/Database.d

    r68 r70  
    11/** 
    22 * Authors: The D DBI project 
    3  * 
    4  * Version: 0.2.5 
    5  * 
    63 * Copyright: BSD license 
    74 */ 
  • trunk/dbi/ErrorCode.d

    r59 r70  
    11/** 
    22 * Authors: The D DBI project 
    3  * 
    4  * Version: 0.2.5 
    5  * 
    63 * Copyright: BSD license 
    74 */ 
  • trunk/dbi/Registry.d

    r65 r70  
     1/** 
     2 * Authors: The D DBI project 
     3 * Copyright: BSD license 
     4 */ 
    15module dbi.Registry; 
    26 
     
    3741 
    3842/** 
    39  * Given a database URL, instaniate and return a Database instance. 
     43 * Given a database URL, instantiate and return a Database instance. 
    4044 *  
    4145 * A database URL looks like: 
  • trunk/dbi/Result.d

    r59 r70  
    11/** 
    22 * Authors: The D DBI project 
    3  * 
    4  * Version: 0.2.5 
    5  * 
    63 * Copyright: BSD license 
    74 */ 
  • trunk/dbi/Row.d

    r67 r70  
    1  
    2 /** 
     1/** 
    32 * Authors: The D DBI project 
    4  * 
    5  * Version: 0.2.5 
    6  * 
    73 * Copyright: BSD license 
    84 */ 
  • trunk/dbi/Statement.d

    r59 r70  
    11/** 
    22 * Authors: The D DBI project 
    3  * 
    4  * Version: 0.2.5 
    5  * 
    63 * Copyright: BSD license 
    74 */ 
  • trunk/dbi/all.d

    r66 r70  
    11/** 
    22 * Authors: The D DBI project 
    3  * 
    4  * Version: 0.2.5 
    5  * 
    63 * Copyright: BSD license 
    74 */ 
  • trunk/dbi/ib/IbDatabase.d

    r59 r70  
    11/** 
    22 * Authors: The D DBI project 
    3  * 
    4  * Version: 0.2.5 
    5  * 
    63 * Copyright: BSD license 
    74 */ 
    85module dbi.ib.IbDatabase; 
     6 
     7version (dbi_ib) { 
    98 
    109private import dbi.Database, dbi.DBIException, dbi.Result, dbi.Row, dbi.Statement; 
     
    107106 
    108107} 
     108 
     109} 
  • trunk/dbi/ib/IbResult.d

    r59 r70  
    11/** 
    22 * Authors: The D DBI project 
    3  * 
    4  * Version: 0.2.5 
    5  * 
    63 * Copyright: BSD license 
    74 */ 
    85module dbi.ib.IbResult; 
     6 
     7version (dbi_ib) { 
    98 
    109private import dbi.DBIException, dbi.Result, dbi.Row; 
     
    4241    private: 
    4342} 
     43} 
  • trunk/dbi/ib/all.d

    r59 r70  
    11/** 
    22 * Authors: The D DBI project 
    3  * 
    4  * Version: 0.2.5 
    5  * 
    63 * Copyright: BSD license 
    74 */ 
     
    129} 
    1310 
     11version (dbi_ib) { 
     12 
    1413public import   dbi.ib.IbDatabase, 
    1514        dbi.ib.IbResult, 
    1615        dbi.all; 
     16} 
  • trunk/dbi/ib/imp.d

    r59 r70  
    1010 * 
    1111 * Authors: The D DBI project 
    12  * 
    1312 * Copyright: BSD license 
    1413 */ 
     
    798797const uint SQL_DIALECT_V6           = 3; /// supports SQL delimited identifier, SQLDATE/DATE, TIME, TIMESTAMP, CURRENT_DATE, CURRENT_TIME, CURRENT_TIMESTAMP, and 64-bit exact numeric type. 
    799798const uint SQL_DIALECT_CURRENT          = SQL_DIALECT_V6; /// latest IB DIALECT. 
     799version (dbi_ib) { 
     800 
    800801 
    801802const uint sec_uid_spec         = 0x01; 
     
    13441345 
    13451346ISC_STATUS isc_suspend_window (ISC_STATUS*, isc_win_handle*); 
     1347 
     1348} 
  • trunk/dbi/msql/MsqlDatabase.d

    r59 r70  
    11/** 
    22 * Authors: The D DBI project 
    3  * 
    4  * Version: 0.2.5 
    5  * 
    63 * Copyright: BSD license 
    74 */ 
    85module dbi.msql.MsqlDatabase; 
     6 
     7version (dbi_msql) { 
    98 
    109private import dbi.Database, dbi.DBIException, dbi.Result, dbi.Row, dbi.Statement; 
     
    104103 
    105104} 
     105 
     106} 
  • trunk/dbi/msql/MsqlResult.d

    r59 r70  
    11/** 
    22 * Authors: The D DBI project 
    3  * 
    4  * Version: 0.2.5 
    5  * 
    63 * Copyright: BSD license 
    74 */ 
    85module dbi.msql.MsqlResult; 
     6 
     7version (dbi_msql) { 
     8 
    99 
    1010private import dbi.DBIException, dbi.Result, dbi.Row; 
     
    4242    private: 
    4343} 
     44 
     45} 
  • trunk/dbi/msql/all.d

    r59 r70  
    11/** 
    22 * Authors: The D DBI project 
    3  * 
    4  * Version: 0.2.5 
    5  * 
    63 * Copyright: BSD license 
    74 */ 
     
    129} 
    1310 
     11version (dbi_msql) { 
     12 
    1413public import   dbi.msql.MsqlDatabase, 
    1514        dbi.msql.MsqlResult, 
    1615        dbi.all; 
     16 
     17} 
  • trunk/dbi/msql/imp.d

    r59 r70  
    1010 * 
    1111 * Authors: The D DBI project 
    12  * 
    1312 * Copyright: BSD license 
    1413 */ 
    1514module dbi.msql.imp; 
     15 
     16version (dbi_msql) { 
    1617 
    1718version (Phobos) { 
     
    547548 */ 
    548549time_t msqlMillidatetimeToUnixTime (char*); 
     550 
     551} 
  • trunk/dbi/mssql/MssqlDatabase.d

    r59 r70  
    11/** 
    22 * Authors: The D DBI project 
    3  * 
    4  * Version: 0.2.5 
    5  * 
    63 * Copyright: BSD license 
    74 */ 
    85module dbi.mssql.MssqlDatabase; 
     6 
     7version (dbi_mssql) { 
    98 
    109version (Phobos) { 
     
    306305    db.close(); 
    307306} 
     307 
     308} 
  • trunk/dbi/mssql/MssqlDate.d

    r59 r70  
    11/** 
    22 * Authors: The D DBI project 
    3  * 
    4  * Version: 0.2.5 
    5  * 
    63 * Copyright: BSD license 
    74 */ 
    85module dbi.mssql.MssqlDate; 
     6 
     7version (dbi_mssql) { 
    98 
    109version (Phobos) { 
     
    106105    } 
    107106} 
     107 
     108} 
  • trunk/dbi/mssql/MssqlResult.d

    r59 r70  
    11/** 
    22 * Authors: The D DBI project 
    3  * 
    4  * Version: 0.2.5 
    5  * 
    63 * Copyright: BSD license 
    74 */ 
    85module dbi.mssql.MssqlResult; 
     6 
     7version (dbi_mssql) { 
    98 
    109version (Phobos) { 
     
    181180    } 
    182181} 
     182 
     183} 
  • trunk/dbi/mssql/all.d

    r59 r70  
    11/** 
    22 * Authors: The D DBI project 
    3  * 
    4  * Version: 0.2.5 
    5  * 
    63 * Copyright: BSD license 
    74 */ 
     
    129} 
    1310 
     11version (dbi_mssql) { 
     12 
    1413public import   dbi.mssql.MssqlDatabase, 
    1514        dbi.mssql.MssqlDate, 
    1615        dbi.mssql.MssqlResult, 
    1716        dbi.all; 
     17 
     18} 
  • trunk/dbi/mssql/imp.d

    r59 r70  
    1 module dbi.mssql.imp; 
     1/** 
     2 * Authors: The D DBI project 
     3 * Copyright: BSD license 
     4 */ 
     5module dbi.mssql.imp; 
     6 
     7version (dbi_mssql) { 
    28 
    39version (Windows) { 
     
    127133  uint mnylow; 
    128134} 
     135 
     136} 
  • trunk/dbi/mysql/MysqlDatabase.d

    r59 r70  
    11/** 
    22 * Authors: The D DBI project 
    3  * 
    4  * Version: 0.2.5 
    5  * 
    63 * Copyright: BSD license 
    74 */ 
    85module dbi.mysql.MysqlDatabase; 
     6 
     7version (dbi_mysql) { 
    98 
    109version (Phobos) { 
     
    1514} else { 
    1615    private import tango.stdc.stringz : toDString = fromUtf8z, toCString = toUtf8z; 
     16        private import tango.io.Console; 
    1717    private static import tango.text.Util; 
    1818    private static import tango.text.convert.Integer; 
    1919    debug (UnitTest) private static import tango.io.Stdout; 
    2020} 
    21 private import dbi.Database, dbi.DBIException, dbi.Result, dbi.Row, dbi.Statement
     21private import dbi.Database, dbi.DBIException, dbi.Result, dbi.Row, dbi.Statement, dbi.Registry
    2222private import dbi.mysql.imp, dbi.mysql.MysqlError, dbi.mysql.MysqlResult; 
    2323 
     
    121121        mysql_real_connect(connection, toCString(host), toCString(username), toCString(password), toCString(dbname), port, toCString(sock), 0); 
    122122        if (uint error = mysql_errno(connection)) { 
     123                Cout("connect(): "); 
     124                Cout(toDString(mysql_error(connection))); 
     125                Cout("\n").flush;            
    123126            throw new DBIException("Unable to connect to the MySQL database.", error, specificToGeneral(error)); 
    124127        } 
     
    135138            mysql_close(connection); 
    136139            if (uint error = mysql_errno(connection)) { 
     140                        Cout("close(): "); 
     141                        Cout(toDString(mysql_error(connection))); 
     142                        Cout("\n").flush;            
    137143                throw new DBIException("Unable to close the MySQL database.", error, specificToGeneral(error)); 
    138144            } 
     
    153159        int error = mysql_real_query(connection, toCString(sql), sql.length); 
    154160        if (error) { 
    155             throw new DBIException("Unable to execute a command on the MySQL database.", sql, error, specificToGeneral(error)); 
     161                Cout("execute(): "); 
     162                Cout(toDString(mysql_error(connection))); 
     163                Cout("\n").flush;            
     164                throw new DBIException("Unable to execute a command on the MySQL database.", sql, error, specificToGeneral(error)); 
    156165        } 
    157166    } 
     
    173182        MYSQL_RES* results = mysql_store_result(connection); 
    174183        if (results is null) { 
     184                Cout("query(): "); 
     185                Cout(toDString(mysql_error(connection))); 
     186                Cout("\n").flush; 
    175187            throw new DBIException("Unable to query the MySQL database.", sql); 
    176188        } 
     
    190202     */ 
    191203    deprecated override int getErrorCode () { 
     204            Cout("GetErrorCode: "); 
     205                Cout(toDString(mysql_error(connection))); 
     206            Cout("\n").flush; 
    192207        return cast(int)mysql_errno(connection); 
    193208    } 
     
    207222    } 
    208223 
     224    /** 
     225     * Get the integer id of the last row to be inserted. 
     226     * 
     227     * Returns: 
     228     *  The id of the last row inserted into the database. 
     229     */ 
     230        override long getLastInsertID() { 
     231                return mysql_insert_id(connection); 
     232        } 
     233 
    209234    private: 
    210235    MYSQL* connection; 
     236} 
     237 
     238private class MysqlRegister : Registerable { 
     239     
     240    public char[] getPrefix() { 
     241        return "mysql"; 
     242    } 
     243     
     244    public Database getInstance(char[] url) { 
     245        //parse the URL here 
     246        return new MysqlDatabase(); 
     247    } 
     248} 
     249 
     250static this() { 
     251    Cout("Attempting to register MysqlDatabase in Registry").newline; 
     252    registerDatabase(new MysqlRegister()); 
    211253} 
    212254 
     
    276318    db.close(); 
    277319} 
     320 
     321} 
  • trunk/dbi/mysql/MysqlError.d

    r59 r70  
    11/** 
    22 * Authors: The D DBI project 
    3  * 
    4  * Version: 0.2.5 
    5  * 
    63 * Copyright: BSD license 
    74 */ 
    85module dbi.mysql.MysqlError; 
     6 
     7version (dbi_mysql) { 
    98 
    109private import dbi.ErrorCode; 
     
    145144    return ErrorCode.Unknown; 
    146145} 
     146 
     147} 
  • trunk/dbi/mysql/MysqlResult.d

    r59 r70  
    11/** 
    22 * Authors: The D DBI project 
    3  * 
    4  * Version: 0.2.5 
    5  * 
    63 * Copyright: BSD license 
    74 */ 
    85module dbi.mysql.MysqlResult; 
     6 
     7version (dbi_mysql) { 
    98 
    109version (Phobos) { 
     
    6665    const uint fieldCount; 
    6766} 
     67 
     68} 
  • trunk/dbi/mysql/all.d

    r59 r70  
    11/** 
    22 * Authors: The D DBI project 
    3  * 
    4  * Version: 0.2.5 
    5  * 
    63 * Copyright: BSD license 
    74 */ 
     
    129} 
    1310 
     11version (dbi_mysql) { 
     12 
    1413public import   dbi.mysql.MysqlDatabase, 
    1514        dbi.mysql.MysqlResult, 
    1615        dbi.all; 
     16 
     17} 
  • trunk/dbi/mysql/imp.d

    r59 r70  
    1 module dbi.mysql.imp; 
     1/** 
     2 * Authors: The D DBI project 
     3 * Copyright: BSD license 
     4 */ 
     5module dbi.mysql.imp; 
     6 
     7version (dbi_mysql) { 
    28 
    39extern (C): 
     
    986992uint mysql_field_count(MYSQL *mysql); 
    987993my_ulonglong mysql_affected_rows(MYSQL *mysql); 
    988 my_ulonglong mysql_insert_id(MYSQL *mysql); 
     994long mysql_insert_id(MYSQL *mysql); 
    989995uint mysql_errno(MYSQL *mysql); 
    990996 char * mysql_error(MYSQL *mysql); 
     
    13221328void mysql_close(MYSQL *sock); 
    13231329uint net_safe_read(MYSQL* mysql); 
     1330 
     1331} 
  • trunk/dbi/odbc/OdbcDatabase.d

    r59 r70  
    11/** 
    22 * Authors: The D DBI project 
    3  * 
    4  * Version: 0.2.5 
    5  * 
    63 * Copyright: BSD license 
    74 */ 
     
    118// WindowsAPI revision 144.  I'll see about fixing their ODBC and SQL files soon. 
    129// WindowsAPI should also include odbc32.lib itself. 
     10 
     11version (dbi_odbc) { 
    1312 
    1413version (Phobos) { 
     
    437436    delete db; 
    438437} 
     438 
     439} 
  • trunk/dbi/odbc/OdbcResult.d

    r59 r70  
    11/** 
    22 * Authors: The D DBI project 
    3  * 
    4  * Version: 0.2.5 
    5  * 
    63 * Copyright: BSD license 
    74 */ 
     
    118// WindowsAPI revision 144.  I'll see about fixing their ODBC and SQL files soon. 
    129// WindowsAPI should also include odbc32.lib itself. 
     10 
     11version (dbi_odbc) { 
    1312 
    1413version (Phobos) { 
     
    153152    } 
    154153} 
     154 
     155} 
  • trunk/dbi/odbc/all.d

    r59 r70  
    11/** 
    22 * Authors: The D DBI project 
    3  * 
    4  * Version: 0.2.5 
    5  * 
    63 * Copyright: BSD license 
    74 */ 
     
    129} 
    1310 
     11 
     12version (dbi_odbc) { 
     13 
    1414public import   dbi.odbc.OdbcDatabase, 
    1515        dbi.odbc.OdbcResult, 
    1616        dbi.all; 
     17 
     18} 
  • trunk/dbi/oracle/OracleDatabase.d

    r59 r70  
    11/** 
    22 * Authors: The D DBI project 
    3  * 
    4  * Version: 0.2.5 
    5  * 
    63 * Copyright: BSD license 
    74 */ 
    85module dbi.oracle.OracleDatabase; 
     6 
     7version (dbi_oracle) { 
    98 
    109private import dbi.Database, dbi.DBIException, dbi.Result, dbi.Row, dbi.Statement; 
     
    153152    OCIStmt* sql; 
    154153} 
     154 
     155} 
  • trunk/dbi/oracle/OracleResult.d

    r59 r70  
    11/** 
    22 * Authors: The D DBI project 
    3  * 
    4  * Version: 0.2.5 
    5  * 
    63 * Copyright: BSD license 
    74 */ 
    85module dbi.oracle.OracleResult; 
     6 
     7version (dbi_oracle) { 
    98 
    109private import dbi.DBIException, dbi.Result, dbi.Row; 
     
    4241    private: 
    4342} 
     43 
     44} 
  • trunk/dbi/oracle/all.d

    r59 r70  
    11/** 
    22 * Authors: The D DBI project 
    3  * 
    4  * Version: 0.2.5 
    5  * 
    63 * Copyright: BSD license 
    74 */ 
     
    129} 
    1310 
     11version (dbi_oracle) { 
     12 
    1413public import   dbi.oracle.OracleDatabase, 
    1514        dbi.oracle.OracleResult, 
    1615        dbi.all; 
     16 
     17} 
  • trunk/dbi/oracle/imp/nzerror.d

    r59 r70  
    1010 * 
    1111 * Authors: The D DBI project 
    12  * 
    1312 * Copyright: BSD license 
    1413 */ 
    1514module dbi.oracle.imp.nzerror; 
     15 
     16 
     17version (dbi_oracle) { 
    1618 
    1719/** 
     
    419421//  return ssl_error == SSLNoErr ? nzerror.NZERROR_OK : cast(nzerror)(ssl_error - SSLMemoryErr + cast(size_t)nzerror.NZERROR_SSLMemoryErr); 
    420422} 
     423 
     424} 
  • trunk/dbi/oracle/imp/nzt.d

    r59 r70  
    1010 * 
    1111 * Authors: The D DBI project 
    12  * 
    1312 * Copyright: BSD license 
    1413 */ 
    1514module dbi.oracle.imp.nzt; 
     15 
     16version (dbi_oracle) { 
    1617 
    1718private import dbi.oracle.imp.nzerror, dbi.oracle.imp.oratypes; 
     
    18491850 */ 
    18501851extern (C) nzerror nztSearchNZDefault (nzctx*, boolean*); 
     1852 
     1853} 
  • trunk/dbi/oracle/imp/oci.d

    r59 r70  
    1010 * 
    1111 * Authors: The D DBI project 
    12  * 
    1312 * Copyright: BSD license 
    1413 */ 
    1514module dbi.oracle.imp.oci; 
    1615 
     16 
     17version (dbi_oracle) { 
    1718 
    1819version (Windows) { 
     
    16971698const uint OCI_MAJOR_VERSION        = 10;       /// Major release version. 
    16981699const uint OCI_MINOR_VERSION        = 2;        /// Minor release version. 
     1700 
     1701} 
  • trunk/dbi/oracle/imp/oci1.d

    r59 r70  
    1010 * 
    1111 * Authors: The D DBI project 
    12  * 
    1312 * Copyright: BSD license 
    1413 */ 
    1514module dbi.oracle.imp.oci1; 
     15 
     16version (dbi_oracle) { 
    1617 
    1718private import dbi.oracle.imp.ociap, dbi.oracle.imp.oratypes; 
     
    223224const uint OCI_EXTRACT_TYPE_INTEGER = 3;        /// Key type is integer. 
    224225const uint OCI_EXTRACT_TYPE_OCINUM  = 4;        /// Key type is ocinum. 
     226 
     227} 
  • trunk/dbi/oracle/imp/oci8dp.d

    r59 r70  
    1010 * 
    1111 * Authors: The D DBI project 
    12  * 
    1312 * Copyright: BSD license 
    1413 */ 
    1514module dbi.oracle.imp.oci8dp; 
     15 
     16version (dbi_oracle) { 
    1617 
    1718private import dbi.oracle.imp.ocidfn, dbi.oracle.imp.oci, dbi.oracle.imp.oratypes; 
     
    251252 */ 
    252253extern (C) sword OCIDirPathStreamReset (OCIDirPathStream* dpstr, OCIError* errhp); 
     254 
     255} 
  • trunk/dbi/oracle/imp/ociap.d

    r59 r70  
    1010 * 
    1111 * Authors: The D DBI project 
    12  * 
    1312 * Copyright: BSD license 
    1413 */ 
    1514module dbi.oracle.imp.ociap; 
     15 
     16version (dbi_oracle) { 
    1617 
    1718version (Phobos) { 
     
    1034210343 */ 
    1034310344deprecated extern (C) sword ocidefn (OCIStmt* stmtp, OCIDefine* defnp, OCIError* errhp, ub4 position, dvoid* valuep, sb4 value_sz, ub2 dty, dvoid* indp, ub2* rlenp, ub2* rcodep, ub4 mode); 
     10345 
     10346} 
  • trunk/dbi/oracle/imp/ociapr.d

    r59 r70  
    1010 * 
    1111 * Authors: The D DBI project 
    12  * 
    1312 * Copyright: BSD license 
    1413 */ 
    1514module dbi.oracle.imp.ociapr; 
     15 
     16version (dbi_oracle) { 
    1617 
    1718private import dbi.oracle.imp.ocidfn, dbi.oracle.imp.oratypes; 
     
    658659 */ 
    659660deprecated extern (C) sword odsc (cda_def* cursor, sword pos, sb2* dbsize, sb2* fsize, sb2* rcode, sb2* dtype, sb1* buf, sb2* bufl, sb2* dsize); 
     661 
     662} 
  • trunk/dbi/oracle/imp/ocidef.d

    r59 r70  
    1010 * 
    1111 * Authors: The D DBI project 
    12  * 
    1312 * Copyright: BSD license 
    1413 */ 
     
    2120#include <riddef.h>     No longer necessary??? 
    2221*/ 
     22 
     23version (dbi_oracle) { 
     24 
    2325private import dbi.oracle.imp.ociapr, dbi.oracle.imp.oratypes; 
    2426 
     
    689691 
    690692extern (C) ub2 ocigft_getFcnType (ub2 oertyp);      /* get sql function code */ 
     693 
     694} 
  • trunk/dbi/oracle/imp/ocidem.d

    r59 r70  
    1010 * 
    1111 * Authors: The D DBI project 
    12  * 
    1312 * Copyright: BSD license 
    1413 */ 
    1514module dbi.oracle.imp.ocidem; 
     15 
     16 
     17version (dbi_oracle) { 
    1618 
    1719private import dbi.oracle.imp.ocidfn, dbi.oracle.imp.oratypes; 
     
    108110    cast(text*)"OSETPI"             /// 
    109111]; 
     112 
     113}