Permalink
Browse files

added code comments

  • Loading branch information...
1 parent 8c2d845 commit f2228e9d554ce69641cc4e1855ee01d315df1256 @jarrettmeyer jarrettmeyer committed Jan 28, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 Massive.PostgreSQL.cs
View
@@ -695,6 +695,10 @@ public int Count()
}
public int Count(string tableName, string where = "")
{
+ // Scalar returns a long that has been casted to an object. Casting a boxed
+ // long directly to int throws InvalidCastException. This will successfully
+ // cast without changing the API.
+ // HACK: Change API so count returns long?
return (int)(long)Scalar("SELECT COUNT(*) FROM " + tableName + " " + where);
}

0 comments on commit f2228e9

Please sign in to comment.