2021-12-26 09:00:58 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Storages/ExternalDataSourceConfiguration.h>
|
2021-12-31 15:23:29 +00:00
|
|
|
#include <Storages/IStorage.h>
|
2021-12-26 09:00:58 +00:00
|
|
|
#include <Storages/MeiliSearch/MeiliSearchConnection.h>
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
2022-05-11 22:42:34 +00:00
|
|
|
class StorageMeiliSearch final : public IStorage
|
2021-12-26 09:00:58 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
StorageMeiliSearch(
|
|
|
|
const StorageID & table_id,
|
2021-12-31 15:23:29 +00:00
|
|
|
const MeiliSearchConfiguration & config_,
|
|
|
|
const ColumnsDescription & columns_,
|
|
|
|
const ConstraintsDescription & constraints_,
|
|
|
|
const String & comment);
|
2021-12-26 09:00:58 +00:00
|
|
|
|
2022-05-16 13:13:05 +00:00
|
|
|
String getName() const override { return "MeiliSearch"; }
|
2021-12-26 09:00:58 +00:00
|
|
|
|
|
|
|
Pipe read(
|
|
|
|
const Names & column_names,
|
2022-04-07 08:56:30 +00:00
|
|
|
const StorageSnapshotPtr & storage_snapshot,
|
2021-12-26 09:00:58 +00:00
|
|
|
SelectQueryInfo & query_info,
|
|
|
|
ContextPtr context,
|
|
|
|
QueryProcessingStage::Enum processed_stage,
|
|
|
|
size_t max_block_size,
|
|
|
|
unsigned num_streams) override;
|
|
|
|
|
2021-12-31 15:23:29 +00:00
|
|
|
SinkToStoragePtr write(const ASTPtr & query, const StorageMetadataPtr & metadata_snapshot, ContextPtr local_context) override;
|
2021-12-30 18:11:12 +00:00
|
|
|
|
2022-02-28 19:43:43 +00:00
|
|
|
MeiliSearchConfiguration static getConfiguration(ASTs engine_args, ContextPtr context);
|
2021-12-30 18:11:12 +00:00
|
|
|
|
2021-12-26 09:00:58 +00:00
|
|
|
private:
|
|
|
|
MeiliSearchConfiguration config;
|
|
|
|
|
2021-12-31 15:23:29 +00:00
|
|
|
Poco::Logger * log;
|
2021-12-26 09:00:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|