aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Storages/MeiliSearch/SinkMeiliSearch.h
blob: 9554a33683944c0a1b942f07b588fdd144fc8871 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#pragma once

#include <Core/ExternalResultDescription.h>
#include <Interpreters/Context.h>
#include <Interpreters/Context_fwd.h>
#include <Processors/Sinks/SinkToStorage.h>
#include <Storages/MeiliSearch/MeiliSearchConnection.h>

namespace DB
{
class SinkMeiliSearch : public SinkToStorage
{
public:
    SinkMeiliSearch(const MeiliSearchConfiguration & config_, const Block & sample_block_, ContextPtr local_context_);

    String getName() const override { return "SinkMeiliSearch"; }

    void consume(Chunk chunk) override;

    void writeBlockData(const Block & block) const;

private:
    MeiliSearchConnection connection;
    ContextPtr local_context;
    Block sample_block;
};

}