2019-11-04 19:18:17 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <ext/shared_ptr_helper.h>
|
|
|
|
#include <Storages/System/IStorageSystemOneBlock.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
class Context;
|
2020-05-08 12:50:45 +00:00
|
|
|
struct QuotaUsage;
|
2019-11-04 19:18:17 +00:00
|
|
|
|
|
|
|
|
2020-05-08 12:50:45 +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
|
|
|
*/
|
2020-03-19 23:48:53 +00:00
|
|
|
class StorageSystemQuotaUsage final : public ext::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();
|
|
|
|
|
2020-05-08 12:50:45 +00:00
|
|
|
static NamesAndTypesList getNamesAndTypesImpl(bool add_column_is_current);
|
2021-04-10 23:33:54 +00:00
|
|
|
static void fillDataImpl(MutableColumns & res_columns, ContextPtr context, bool add_column_is_current, const std::vector<QuotaUsage> & quotas_usage);
|
2020-05-08 12:50:45 +00:00
|
|
|
|
2019-11-04 19:18:17 +00:00
|
|
|
protected:
|
|
|
|
friend struct ext::shared_ptr_helper<StorageSystemQuotaUsage>;
|
|
|
|
using IStorageSystemOneBlock::IStorageSystemOneBlock;
|
2021-04-10 23:33:54 +00:00
|
|
|
void fillData(MutableColumns & res_columns, ContextPtr context, const SelectQueryInfo &) const override;
|
2019-11-04 19:18:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|