ClickHouse/src/Storages/System/StorageSystemQuotaUsage.h

32 lines
1.0 KiB
C++
Raw Normal View History

2019-11-04 19:18:17 +00:00
#pragma once
2021-06-15 19:55:21 +00:00
#include <common/shared_ptr_helper.h>
2019-11-04 19:18:17 +00:00
#include <Storages/System/IStorageSystemOneBlock.h>
namespace DB
{
class Context;
struct QuotaUsage;
2019-11-04 19:18:17 +00:00
/** Implements the `quota_usage` system table, which allows you to get information about
* how the current user uses the quota.
2019-11-04 19:18:17 +00:00
*/
2021-06-15 19:55:21 +00:00
class StorageSystemQuotaUsage final : public shared_ptr_helper<StorageSystemQuotaUsage>, public IStorageSystemOneBlock<StorageSystemQuotaUsage>
2019-11-04 19:18:17 +00:00
{
public:
std::string getName() const override { return "SystemQuotaUsage"; }
static NamesAndTypesList getNamesAndTypes();
static NamesAndTypesList getNamesAndTypesImpl(bool add_column_is_current);
static void fillDataImpl(MutableColumns & res_columns, ContextPtr context, bool add_column_is_current, const std::vector<QuotaUsage> & quotas_usage);
2019-11-04 19:18:17 +00:00
protected:
2021-06-15 19:55:21 +00:00
friend struct shared_ptr_helper<StorageSystemQuotaUsage>;
2019-11-04 19:18:17 +00:00
using IStorageSystemOneBlock::IStorageSystemOneBlock;
void fillData(MutableColumns & res_columns, ContextPtr context, const SelectQueryInfo &) const override;
2019-11-04 19:18:17 +00:00
};
}