aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Storages/MeiliSearch/StorageMeiliSearch.h
blob: 77cd2afb80a1d5cf84d7e9f5dafca5b100491d56 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once

#include <Storages/IStorage.h>
#include <Storages/MeiliSearch/MeiliSearchConnection.h>

namespace DB
{
class StorageMeiliSearch final : public IStorage
{
public:
    StorageMeiliSearch(
        const StorageID & table_id,
        const MeiliSearchConfiguration & config_,
        const ColumnsDescription & columns_,
        const ConstraintsDescription & constraints_,
        const String & comment);

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

    Pipe read(
        const Names & column_names,
        const StorageSnapshotPtr & storage_snapshot,
        SelectQueryInfo & query_info,
        ContextPtr context,
        QueryProcessingStage::Enum processed_stage,
        size_t max_block_size,
        size_t num_streams) override;

    SinkToStoragePtr write(const ASTPtr & query, const StorageMetadataPtr & metadata_snapshot, ContextPtr local_context, bool async_insert) override;

    static MeiliSearchConfiguration getConfiguration(ASTs engine_args, ContextPtr context);

    static ColumnsDescription getTableStructureFromData(const MeiliSearchConfiguration & config_);

private:
    MeiliSearchConfiguration config;

    Poco::Logger * log;
};

}