diff options
author | Daniel Burrows <dburrows@debian.org> | 2009-07-27 20:27:20 -0700 |
---|---|---|
committer | Daniel Burrows <dburrows@debian.org> | 2009-07-27 20:27:20 -0700 |
commit | 21323694e8c8b9f19eb55e7e293c56d559eda7b4 (patch) | |
tree | 2d4d488da36abb52ce52c36d16a729baf6273192 | |
parent | 9173169f051a8001135cfa4cdffde40d268c153d (diff) | |
download | aptitude-21323694e8c8b9f19eb55e7e293c56d559eda7b4.tar.gz |
Bind sqlite3_column_type() so that client code can retrieve the type of a column.
-rw-r--r-- | src/generic/util/sqlite.cc | 5 | ||||
-rw-r--r-- | src/generic/util/sqlite.h | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/generic/util/sqlite.cc b/src/generic/util/sqlite.cc index 0f444c17..fe33d7c4 100644 --- a/src/generic/util/sqlite.cc +++ b/src/generic/util/sqlite.cc @@ -263,6 +263,11 @@ namespace aptitude throw exception(parent.get_error(), result); } + int statement::get_column_type(int column) + { + return sqlite3_column_type(handle, column); + } + const void *statement::get_blob(int column, int &bytes) { require_data(); diff --git a/src/generic/util/sqlite.h b/src/generic/util/sqlite.h index ef1b0aed..950e37d0 100644 --- a/src/generic/util/sqlite.h +++ b/src/generic/util/sqlite.h @@ -374,6 +374,11 @@ namespace aptitude /** \brief Retrieve the value stored in a column as a string. */ std::string get_string(int column); + + /** \brief Retrieve the data type stored in the given column of + * the current row. + */ + int get_column_type(int column); }; class blob |