Skip to content

Commit 7475de6

Browse files
committed
Updating node-db
1 parent 7fd301e commit 7475de6

File tree

5 files changed

+11
-3
lines changed

5 files changed

+11
-3
lines changed

lib/node-db

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
, "description" : "MySQL database bindings for Node.JS"
33
, "keywords": ["database","db","native","binding","library","plugin","client","mysql","libmysql"]
44
, "homepage" : "http://nodejsdb.org/db-mysql"
5-
, "version" : "0.5.0"
5+
, "version" : "0.5.1"
66
, "engines" : { "node" : ">=0.4.1" }
77
, "maintainers" :
88
[ { "name": "Mariano Iglesias"

src/result.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ node_db::Result::Column::type_t node_db_mysql::Result::Column::getType() const {
7070
node_db_mysql::Result::Result(MYSQL* connection, MYSQL_RES* result) throw(node_db::Exception&)
7171
: columns(NULL),
7272
totalColumns(0),
73+
totalRows(0),
7374
rowNumber(0),
7475
connection(connection),
7576
result(result),
@@ -84,6 +85,7 @@ node_db_mysql::Result::Result(MYSQL* connection, MYSQL_RES* result) throw(node_d
8485
throw node_db::Exception("Could not buffer columns");
8586
}
8687

88+
this->totalRows = mysql_num_rows(this->result);
8789
this->totalColumns = mysql_num_fields(this->result);
8890
if (this->totalColumns > 0) {
8991
this->columns = new Column*[this->totalColumns];
@@ -164,3 +166,7 @@ uint16_t node_db_mysql::Result::warningCount() const {
164166
uint16_t node_db_mysql::Result::columnCount() const {
165167
return this->totalColumns;
166168
}
169+
170+
uint64_t node_db_mysql::Result::count() const throw() {
171+
return this->totalRows;
172+
}

src/result.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,12 @@ class Result : public node_db::Result {
3636
uint16_t columnCount() const;
3737
uint64_t affectedCount() const;
3838
uint16_t warningCount() const;
39+
uint64_t count() const throw();
3940

4041
protected:
4142
Column **columns;
4243
uint16_t totalColumns;
44+
uint64_t totalRows;
4345
uint64_t rowNumber;
4446

4547
char **row() throw(node_db::Exception&);

wscript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ from os.path import exists
1111

1212
srcdir = "."
1313
blddir = "build"
14-
VERSION = "0.5.0"
14+
VERSION = "0.5.1"
1515

1616
def set_options(opt):
1717
opt.tool_options("compiler_cxx")

0 commit comments

Comments
 (0)