| 19 | ")"; |
| 20 | |
| 21 | static 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 | // ���ӱ����� |
| 52 | static bool tbl_insert(acl::db_handle& db, int n) |
no test coverage detected
searching dependent graphs…