From 86c89decd9599d6599527748d925ac7d24b31905 Mon Sep 17 00:00:00 2001 From: Erik Smith Date: Thu, 23 Jun 2016 11:26:06 -0700 Subject: [PATCH] empty, stmt into bug fix README correction --- README.md | 2 +- src/std/database/front.d | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 23e1a3b..c16790c 100644 --- a/README.md +++ b/README.md @@ -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(); } diff --git a/src/std/database/front.d b/src/std/database/front.d index b9ebc1e..ca72e6c 100644 --- a/src/std/database/front.d +++ b/src/std/database/front.d @@ -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; } @@ -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]; @@ -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();} }