MCPcopy Create free account
hub / github.com/acl-dev/acl / get

Method get

lib_fiber/samples-c++/pgsql/main.cpp:72–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70 }
71
72 bool get(acl::db_handle& db, int n)
73 {
74 acl::query query;
75 query.create_sql("select * from group_tbl"
76 " where group_name=:group"
77 " and uvip_tbl=:test")
78 .set_format("group", "group:%lu:%d", id_, n)
79 .set_format("test", "test");
80 if (db.exec_select(query) == false)
81 {
82 printf("exec_select error: %s\r\n", db.get_error());
83 return false;
84 }
85
86 const acl::db_rows* result = db.get_result();
87 if (__show_results && result)
88 {
89 const std::vector<acl::db_row*>& rows =
90 result->get_rows();
91 for (size_t i = 0; i < rows.size(); i++)
92 {
93 if (n > 10)
94 continue;
95 const acl::db_row* row = rows[i];
96 for (size_t j = 0; j < row->length(); j++)
97 printf("%s, ", (*row)[j]);
98 printf("\r\n");
99 }
100 }
101
102 db.free_result();
103 return true;
104 }
105};
106
107//////////////////////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 7

exec_selectMethod · 0.80
get_rowsMethod · 0.80
free_resultMethod · 0.80
get_errorMethod · 0.45
get_resultMethod · 0.45
sizeMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected