Wrote the copy operation

This commit is contained in:
Dr. Patrick Urbanke
2025-04-25 05:08:48 +02:00
parent 4942aeadd0
commit 78d94298ec
2 changed files with 51 additions and 5 deletions
+6 -5
View File
@@ -43,15 +43,13 @@ class Connection : public sqlgen::Connection {
std::string to_sql(const dynamic::Statement& _stmt) noexcept final;
Result<Nothing> start_write(const dynamic::Insert& _stmt) final {
return error("TODO");
return execute(to_sql(_stmt));
}
Result<Nothing> end_write() final { return error("TODO"); }
Result<Nothing> end_write() final;
Result<Nothing> write(
const std::vector<std::vector<std::optional<std::string>>>& _data) final {
return error("TODO");
}
const std::vector<std::vector<std::optional<std::string>>>& _data) final;
private:
std::string add_not_null_if_necessary(
@@ -77,6 +75,9 @@ class Connection : public sqlgen::Connection {
std::string select_from_to_sql(
const dynamic::SelectFrom& _stmt) const noexcept;
std::string to_buffer(
const std::vector<std::optional<std::string>>& _line) const noexcept;
std::string type_to_sql(const dynamic::Type& _type) const noexcept;
static std::string wrap_in_quotes(const std::string& _name) noexcept {