added describe table and table exists to session

This commit is contained in:
2023-11-26 22:17:59 +01:00
parent a436af5293
commit f3c502a2ce
6 changed files with 33 additions and 27 deletions
+18
View File
@@ -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_;