added describe table and table exists to session
This commit is contained in:
@@ -73,6 +73,24 @@ std::pair<size_t, std::string> session::execute(const std::string &sql) const {
|
||||
return c->execute(sql);
|
||||
}
|
||||
|
||||
record session::describe_table(const std::string &table_name) const
|
||||
{
|
||||
auto c = pool_.acquire();
|
||||
if (!c.valid()) {
|
||||
throw std::logic_error("no database connection available");
|
||||
}
|
||||
return c->describe(table_name);
|
||||
}
|
||||
|
||||
bool session::table_exists(const std::string &table_name) const
|
||||
{
|
||||
auto c = pool_.acquire();
|
||||
if (!c.valid()) {
|
||||
throw std::logic_error("no database connection available");
|
||||
}
|
||||
return c->exists(table_name);
|
||||
}
|
||||
|
||||
const table_repository& session::tables() const
|
||||
{
|
||||
return table_repository_;
|
||||
|
||||
Reference in New Issue
Block a user