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

Function tbl_create

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

Source from the content-addressed store, hash-verified

19 ")";
20
21static bool tbl_create(const char* dbaddr, const char* dbname,
22 const char* dbuser, const char* dbpass)
23{
24 acl::pgsql_conf conf(dbaddr, dbname);
25 conf.set_dbuser(dbuser).set_dbpass(dbpass);
26 acl::db_pgsql db(conf);
27 if (db.open() == false)
28 {
29 printf("open %s@pgsql error, dbuser: %s, dbpass: %s\r\n",
30 dbaddr, dbuser, dbpass);
31 return false;
32 }
33
34 if (db.tbl_exists("group_tbl"))
35 {
36 printf("table exist\r\n");
37 return (true);
38 }
39 else if (db.sql_update(CREATE_TBL) == false)
40 {
41 printf("sql error\r\n");
42 return (false);
43 }
44 else
45 {
46 printf("create table ok\r\n");
47 return (true);
48 }
49}
50
51// ���ӱ�����
52static 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…