Skip to content

Commit

Permalink
revert row index data type for database
Browse files Browse the repository at this point in the history
to allow for negative rows (counting from the end)
  • Loading branch information
Alexander Voigt authored and Alexander Voigt committed Nov 15, 2016
1 parent 037fc0f commit e9869d4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/database.cpp
Expand Up @@ -93,7 +93,7 @@ void Database::insert(
* @param row row index (0 = 1st row, 1 = 2nd row, ..., -1 = last row,
* -2 is 2nd to last row, ...)
*/
Eigen::ArrayXd Database::extract(const std::string& table_name, std::size_t row)
Eigen::ArrayXd Database::extract(const std::string& table_name, long long row)
{
Eigen::ArrayXd values;
const std::string sql =
Expand Down Expand Up @@ -239,7 +239,7 @@ void Database::insert(
throw DisabledSQLiteError("Cannot call insert(), because SQLite support is disabled.");
}

Eigen::ArrayXd Database::extract(const std::string&, std::size_t)
Eigen::ArrayXd Database::extract(const std::string&, long long)
{
throw DisabledSQLiteError("Cannot call extract(), because SQLite support is disabled.");
}
Expand Down
2 changes: 1 addition & 1 deletion src/database.hpp
Expand Up @@ -38,7 +38,7 @@ class Database {
void insert(const std::string&, const std::vector<std::string>&, const Eigen::ArrayXd&);

/// extract a row of doubles from a table
Eigen::ArrayXd extract(const std::string&, std::size_t);
Eigen::ArrayXd extract(const std::string&, long long);

private:
using TCallback = int (*)(void*, int, char**, char**);
Expand Down

0 comments on commit e9869d4

Please sign in to comment.