Skip to content

Commit 86c89de

Browse files
committed
empty, stmt into bug fix
README correction
1 parent 03c4c12 commit 86c89de

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ auto con = db.connection();
3737
auto stmt = con.statement("select * from table");
3838
auto rows = stmt.query.rows;
3939
foreach (row; rows) {
40-
for(size_t col = 0; col != row.columns; ++col) write(rowr[col]), " ");
40+
for(size_t col = 0; col != row.width; ++col) write(row[col], " ");
4141
writeln();
4242
}
4343

src/std/database/front.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ struct BasicStatement(D,P) {
268268

269269
auto into(A...) (ref A args) {
270270
if (state != State.Executed) throw new DatabaseException("not executed");
271+
rows.into(args);
271272
return this;
272273
}
273274

@@ -438,7 +439,6 @@ struct BasicRowSet(D,P) {
438439

439440
auto into(A...) (ref A args) {
440441
if (!result_.rowsFetched()) throw new DatabaseException("no data");
441-
442442
auto row = front();
443443
foreach(i, ref a; args) {
444444
alias T = A[i];
@@ -480,7 +480,7 @@ struct BasicRowSet(D,P) {
480480
}
481481

482482

483-
bool empty() {return result_.rowsFetched_ != 0;}
483+
bool empty() {return result_.rowsFetched_ == 0;}
484484
auto front() {return Row(this);}
485485
void popFront() {result_.next();}
486486
}

0 commit comments

Comments
 (0)