5#include "../DataBinder/SqlRawColumn.hpp"
6#include "../SqlSchema.hpp"
7#include "../SqlServerType.hpp"
8#include "SqlBackupFormats.hpp"
14namespace Lightweight::detail
21#pragma warning(disable: 4251)
25struct LIGHTWEIGHT_API BatchManager
27 using BatchExecutor = std::function<void(std::vector<SqlRawColumn>
const&,
size_t)>;
35 explicit BatchManager(BatchExecutor executor,
36 std::vector<SqlColumnDeclaration>
const& colDecls,
38 SqlServerType serverType = SqlServerType::UNKNOWN);
42 BatchManager(BatchManager
const&) =
delete;
43 BatchManager& operator=(BatchManager
const&) =
delete;
44 BatchManager(BatchManager&&) noexcept;
45 BatchManager& operator=(BatchManager&&) noexcept;
48 void PushRow(std::vector<SqlBackup::BackupValue> const& row);
51 void PushBatch(SqlBackup::ColumnBatch const& batch);
57 [[nodiscard]] std::unique_ptr<BatchColumn> CreateColumn(SqlColumnDeclaration const& col) const;
60 size_t capacity = 1000;
61 BatchExecutor executor;
62 std::vector<std::unique_ptr<BatchColumn>> columns;
63 SqlServerType serverType = SqlServerType::UNKNOWN;