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

Function query_text

dlib/sqlite/sqlite_tools.h:76–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74// ----------------------------------------------------------------------------------------
75
76 inline std::string query_text (
77 database& db,
78 const std::string& query
79 )
80 {
81 statement st(db, query);
82 st.exec();
83 if (st.move_next() && st.get_num_columns() == 1)
84 {
85 const std::string& temp = st.get_column_as_text(0);
86 if (st.move_next())
87 throw sqlite_error("query doesn't result in exactly 1 element");
88 return temp;
89 }
90 else
91 {
92 throw sqlite_error("query doesn't result in exactly 1 element");
93 }
94 }
95
96// ----------------------------------------------------------------------------------------
97

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected