Note: This website is archived. For up-to-date information about D projects and development, please visit

0.3.0 Usage Examples


MssqlDatabase db = new MssqlDatabase()


  • Data in Row object is in void[] for each field
  • Result object overhauled
    • contains Row m_currentRow
    • Can do something like Row[] m_rows for a CachedResultSet in future
    • contains ColInfo[] m_fields
  • ColInfo object is new, contains properties of fields
    • name
    • declaration
    • type
    • varlen
    • precision
    • scale
  • ColInfo could also contain properties (borrowed from JTDS jdbc driver for MSSQL):
    • different name for actual field in db vs. label used in D code
    • table
    • catalog
    • schema
    • nullable
    • isCaseSensitive
    • isWriteable
    • isIdentity
    • isKey
    • isHidden
    • collation (MSSQL-specific?)
    • charsetInfo
    • displaySize
    • bufferSize


Note: this works on my local, I want to get thoughts before proceeding

  • doesn't yet have connect string in URL format like above
  • needs testing for other data types
  • ColInfo type information can be used in Result to warn/throw based on method used to retrieve data
  • getXxxx methods need to accept char[] fieldname
    • keep an AA of the fields in Result?
import dbi.mssql.MssqlDatabase;
import dbi.Result, dbi.Row;

void main() {

	MssqlDatabase db = new MssqlDatabase();
	db.connect("sqlvs1 1433","test","test");
	char[] sql = "USE admin; SELECT * FROM test;";
	Result rs = db.query(sql);

	while ( ) {
	  Stdout (rs.getString(0)) (", ") (rs.getInt(1)).newline;	  



hello world, 42
yo, wutup?, 43