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

Method tbl_exists

lib_acl_cpp/src/db/db_pgsql.cpp:575–595  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

573}
574
575bool db_pgsql::tbl_exists(const char* tbl_name)
576{
577 free_result();
578
579 db_rows rows;
580 string sql;
581 sql.format("select * from %s limit 1", tbl_name);
582
583 PGresult* res = (PGresult *) sane_pgsql_query(sql);
584 if (res == NULL) {
585 return false;
586 }
587
588 if (__dbresult_status(res) != PGRES_TUPLES_OK) {
589 __dbclear(res);
590 return false;
591 }
592
593 __dbclear(res);
594 return true;
595}
596
597bool db_pgsql::sql_select(const char* sql, db_rows* result /* = NULL */)
598{

Callers 15

tbl_createMethod · 0.45
tbl_createFunction · 0.45
tbl_createFunction · 0.45
tbl_createFunction · 0.45
tbl_createFunction · 0.45
tbl_createFunction · 0.45
tbl_createFunction · 0.45
tbl_createFunction · 0.45
tbl_createFunction · 0.45
db_createMethod · 0.45
create_option_tblFunction · 0.45
create_mail_tblMethod · 0.45

Calls 1

formatMethod · 0.45

Tested by

no test coverage detected