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

Function query_double

dlib/sqlite/sqlite_tools.h:98–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96// ----------------------------------------------------------------------------------------
97
98 inline double query_double (
99 database& db,
100 const std::string& query
101 )
102 {
103 statement st(db, query);
104 st.exec();
105 if (st.move_next() && st.get_num_columns() == 1)
106 {
107 double temp = st.get_column_as_double(0);
108 if (st.move_next())
109 throw sqlite_error("query doesn't result in exactly 1 element");
110 return temp;
111 }
112 else
113 {
114 throw sqlite_error("query doesn't result in exactly 1 element");
115 }
116 }
117
118// ----------------------------------------------------------------------------------------
119

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected