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

Function tbl_create

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

Source from the content-addressed store, hash-verified

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

Callers 1

mainFunction · 0.70

Calls 3

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…