mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-13 18:02:24 +00:00
4e76629aaf
- lots of static_cast - add safe_cast - types adjustments - config - IStorage::read/watch - ... - some TODO's (to convert types in future) P.S. That was quite a journey... v2: fixes after rebase v3: fix conflicts after #42308 merged Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
55 lines
1.2 KiB
C++
55 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include "config.h"
|
|
|
|
#if USE_SQLITE
|
|
#include <Storages/IStorage.h>
|
|
|
|
#include <sqlite3.h>
|
|
|
|
namespace Poco
|
|
{
|
|
class Logger;
|
|
}
|
|
|
|
namespace DB
|
|
{
|
|
|
|
class StorageSQLite final : public IStorage, public WithContext
|
|
{
|
|
public:
|
|
using SQLitePtr = std::shared_ptr<sqlite3>;
|
|
|
|
StorageSQLite(
|
|
const StorageID & table_id_,
|
|
SQLitePtr sqlite_db_,
|
|
const String & database_path_,
|
|
const String & remote_table_name_,
|
|
const ColumnsDescription & columns_,
|
|
const ConstraintsDescription & constraints_,
|
|
ContextPtr context_);
|
|
|
|
std::string getName() const override { return "SQLite"; }
|
|
|
|
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 context) override;
|
|
|
|
private:
|
|
String remote_table_name;
|
|
String database_path;
|
|
SQLitePtr sqlite_db;
|
|
Poco::Logger * log;
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|