| 139 | } |
| 140 | |
| 141 | bool Connection::CheckTableExists(std::string_view tableName) const |
| 142 | { |
| 143 | auto stmt = CreateStatement( |
| 144 | "SELECT EXISTS(SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = ?)"); |
| 145 | |
| 146 | if (!stmt) |
| 147 | return false; |
| 148 | |
| 149 | auto result = stmt->Prepare(tableName).Run(); |
| 150 | |
| 151 | if (!result.HasRows()) |
| 152 | return false; |
| 153 | |
| 154 | for (auto row : result) |
| 155 | return row.GetOr(0, false); |
| 156 | |
| 157 | return false; |
| 158 | } |
| 159 | |
| 160 | Error Connection::Execute(std::string_view sql) noexcept |
| 161 | { |
no test coverage detected