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

Function tbl_insert

lib_acl_cpp/samples/db/pgsql_pool/main.cpp:52–79  ·  view source on GitHub ↗

���ӱ�����

Source from the content-addressed store, hash-verified

50
51// ���ӱ�����
52static bool tbl_insert(acl::db_handle& db, int n)
53{
54 acl::query query;
55 query.create_sql("insert into group_tbl(group_name, uvip_tbl,"
56 " update_date) values(:group, :test, :date)")
57 .set_format("group", "group:%d", n)
58 .set_parameter("test", "test")
59 .set_date("date", time(NULL), "%Y-%m-%d");
60
61 if (db.exec_update(query) == false)
62 return (false);
63
64 const acl::db_rows* result = db.get_result();
65 if (result)
66 {
67 const std::vector<acl::db_row*>& rows = result->get_rows();
68 for (size_t i = 0; i < rows.size(); i++)
69 {
70 const acl::db_row* row = rows[i];
71 for (size_t j = 0; j < row->length(); j++)
72 printf("%s, ", (*row)[j]);
73 printf("\r\n");
74 }
75 }
76
77 db.free_result();
78 return (true);
79}
80
81// ��ѯ������
82static int tbl_select(acl::db_handle& db, int n)

Callers 1

runMethod · 0.70

Calls 7

set_parameterMethod · 0.80
exec_updateMethod · 0.80
get_rowsMethod · 0.80
free_resultMethod · 0.80
get_resultMethod · 0.45
sizeMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…