Skip to content

Commit

Permalink
empty, stmt into bug fix
Browse files Browse the repository at this point in the history
README correction
  • Loading branch information
cruisercoder committed Jun 23, 2016
1 parent 03c4c12 commit 86c89de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ auto con = db.connection();
auto stmt = con.statement("select * from table");
auto rows = stmt.query.rows;
foreach (row; rows) {
for(size_t col = 0; col != row.columns; ++col) write(rowr[col]), " ");
for(size_t col = 0; col != row.width; ++col) write(row[col], " ");
writeln();
}
Expand Down
4 changes: 2 additions & 2 deletions src/std/database/front.d
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ struct BasicStatement(D,P) {

auto into(A...) (ref A args) {
if (state != State.Executed) throw new DatabaseException("not executed");
rows.into(args);
return this;
}

Expand Down Expand Up @@ -438,7 +439,6 @@ struct BasicRowSet(D,P) {

auto into(A...) (ref A args) {
if (!result_.rowsFetched()) throw new DatabaseException("no data");

auto row = front();
foreach(i, ref a; args) {
alias T = A[i];
Expand Down Expand Up @@ -480,7 +480,7 @@ struct BasicRowSet(D,P) {
}


bool empty() {return result_.rowsFetched_ != 0;}
bool empty() {return result_.rowsFetched_ == 0;}
auto front() {return Row(this);}
void popFront() {result_.next();}
}
Expand Down

0 comments on commit 86c89de

Please sign in to comment.