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

Function tbl_create

lib_acl_cpp/samples/db/mysql_pool/main.cpp:73–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73static bool tbl_create(const char* dbaddr, const char* dbname,
74 const char* dbuser, const char* dbpass)
75{
76 acl::db_mysql db(dbaddr, dbname, dbuser, dbpass);
77 if (db.open() == false)
78 {
79 printf("open %s@mysql error, dbuser: %s, dbpass: %s\r\n",
80 dbaddr, dbuser, dbpass);
81 return false;
82 }
83
84 printf("mysqlclient lib's version: %ld, info: %s\r\n",
85 db.mysql_libversion(), db.mysql_client_info());
86
87 if (db.tbl_exists("group_tbl"))
88 {
89 printf("table exist\r\n");
90 return (true);
91 }
92 else if (db.sql_update(CREATE_TBL) == false)
93 {
94 printf("sql error\r\n");
95 return (false);
96 }
97 else
98 {
99 printf("create table ok\r\n");
100 return (true);
101 }
102}
103
104// ���ӱ�����
105static bool tbl_insert(acl::db_handle& db, int n)

Callers 1

mainFunction · 0.70

Calls 5

mysql_libversionMethod · 0.80
mysql_client_infoMethod · 0.80
openMethod · 0.45
tbl_existsMethod · 0.45
sql_updateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…