DDBI

dbi.model.Result

Authors:
The D DBI project

class Result ;


abstract bool nextRow ();
Loads the next row in the result set.

Returns:
true if there was next row and it was correctly loaded, false if there was not another row or there was an error loading it.

bool fetchRow (BindTypes...)(ref BindTypes bind);
Fetchs a row from the current result set binding the returned field values to the variadic arguments provided in the call to fetchRow ().

Arguments of the following types can be used as bind arguments: bool byte ubyte short ushort int uint long ulong float double char[] void[] ubyte[] tango.time.Time tango.time.DateTime dbi.model.BindType.BindInfo

Examples:
	uint id;
	char name;

	while(res.fetchRow(id,name)) {
		Stdout.formatln("id: {}, name: {}", id, name);
	}


Returns:
true if a row was successfully loaded and bound to the passed arguments, false if there are no more rows

abstract ulong rowCount ();
Returns:
The number of rows in the current result set

abstract ulong fieldCount ();
Returns:
The number of fields per row for the current result set.

abstract ulong affectedRows ();
Returns the number of rows affected by the current sql statement.

For multi-statement sql queries, when nextResult() returns true a valid result set will be present (in which case validResult() will return true) and/or affectedRows () will be valid (for statements which do not return a result set).

Returns:
The number of rows affected by the current sql statement.

abstract FieldInfo[] rowMetadata ();
Returns:
the row metadata for the current result set.

abstract bool validResult ();
Returns:
true if the current result set is valid, false otherwise. validResult () may return false even if there are still additional result sets. For statements which do not return result sets but modify data, check affectedRows().



abstract void closeResult ();
Closes all result sets for the current query.

Any call to nextResult() after calling closeResult () will fail and return false.

abstract bool moreResults ();
Returns:
true if there are more results, false otherwise.

abstract bool nextResult ();
Loads the next result set if there is one.

Returns:
true if there was another result and it was loaded properly, false otherwise.

abstract bool getField (ref bool, uint idx);


abstract bool getField (ref ubyte, uint idx);


abstract bool getField (ref byte, uint idx);


abstract bool getField (ref ushort, uint idx);


abstract bool getField (ref short, uint idx);


abstract bool getField (ref uint, uint idx);


abstract bool getField (ref int, uint idx);


abstract bool getField (ref ulong, uint idx);


abstract bool getField (ref long, uint idx);


abstract bool getField (ref float, uint idx);


abstract bool getField (ref double, uint idx);


abstract bool getField (ref char[], uint idx);


abstract bool getField (ref ubyte[], uint idx);


abstract bool getField (ref Time, uint idx);


abstract bool getField (ref DateTime, uint idx);


Documentation last updated Tue Jan 27 00:09:27 2009