summaryrefslogtreecommitdiff
path: root/include/modules/sql.h
diff options
context:
space:
mode:
authorDaniel Vassdal <shutter@canternet.org>2015-03-02 03:06:55 +0100
committerPeter Powell <petpow@saberuk.com>2018-04-07 11:50:08 +0100
commitd38f2ad213e875d40556116cba3230064eacb861 (patch)
tree3aa8bd0b9c3ba0ab7c337c42be53f7756becc07e /include/modules/sql.h
parent4ec475ba10b65785277ed9dab5f99775289165b3 (diff)
SQL: Add HasColumn() to check if a result contains a named column.
Diffstat (limited to 'include/modules/sql.h')
-rw-r--r--include/modules/sql.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/modules/sql.h b/include/modules/sql.h
index 14cd60a56..59955107d 100644
--- a/include/modules/sql.h
+++ b/include/modules/sql.h
@@ -122,6 +122,15 @@ class SQL::Result : public classbase
* @param result A reference to the vector to store column names in.
*/
virtual void GetCols(std::vector<std::string>& result) = 0;
+
+ /**
+ * Check if there's a column with the specified name in the result
+ *
+ * @param the column name
+ * @param on success, this is the column index
+ * @returns true, or false if the column is not found
+ */
+ virtual bool HasColumn(const std::string& column, size_t& index) = 0;
};
/** SQL::Error holds the error state of a request.