MCPcopy Create free account
hub / github.com/davisking/dlib / query_int64

Function query_int64

dlib/sqlite/sqlite_tools.h:142–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140// ----------------------------------------------------------------------------------------
141
142 inline int64 query_int64 (
143 database& db,
144 const std::string& query
145 )
146 {
147 statement st(db, query);
148 st.exec();
149 if (st.move_next() && st.get_num_columns() == 1)
150 {
151 int64 temp = st.get_column_as_int64(0);
152 if (st.move_next())
153 throw sqlite_error("query doesn't result in exactly 1 element");
154 return temp;
155 }
156 else
157 {
158 throw sqlite_error("query doesn't result in exactly 1 element");
159 }
160 }
161
162// ----------------------------------------------------------------------------------------
163

Callers

nothing calls this directly

Calls 5

execMethod · 0.80
get_num_columnsMethod · 0.80
get_column_as_int64Method · 0.80
sqlite_errorClass · 0.70
move_nextMethod · 0.45

Tested by

no test coverage detected