mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-19 22:22:00 +00:00
Added constraints getter and setter to IStorage
This commit is contained in:
parent
19d099f90a
commit
773849a43d
@ -47,6 +47,16 @@ void IStorage::setIndices(IndicesDescription indices_)
|
||||
indices = std::move(indices_);
|
||||
}
|
||||
|
||||
const ConstraintsDescription & IStorage::getConstraints() const
|
||||
{
|
||||
return constraints;
|
||||
}
|
||||
|
||||
void IStorage::setConstraints(ConstraintsDescription constraints_)
|
||||
{
|
||||
constraints = std::move(constraints_);
|
||||
}
|
||||
|
||||
NameAndTypePair IStorage::getColumn(const String & column_name) const
|
||||
{
|
||||
/// By default, we assume that there are no virtual columns in the storage.
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include <Common/ActionLock.h>
|
||||
#include <Common/Exception.h>
|
||||
#include <Common/RWLock.h>
|
||||
#include <Storages/ConstraintsDescription.h>
|
||||
|
||||
#include <optional>
|
||||
#include <shared_mutex>
|
||||
@ -88,6 +89,9 @@ public: /// thread-unsafe part. lockStructure must be acquired
|
||||
const IndicesDescription & getIndices() const;
|
||||
void setIndices(IndicesDescription indices_);
|
||||
|
||||
const ConstraintsDescription & getConstraints() const;
|
||||
void setConstraints(ConstraintsDescription constraints_);
|
||||
|
||||
/// NOTE: these methods should include virtual columns,
|
||||
/// but should NOT include ALIAS columns (they are treated separately).
|
||||
virtual NameAndTypePair getColumn(const String & column_name) const;
|
||||
@ -115,6 +119,7 @@ public: /// thread-unsafe part. lockStructure must be acquired
|
||||
private:
|
||||
ColumnsDescription columns;
|
||||
IndicesDescription indices;
|
||||
ConstraintsDescription constraints;
|
||||
|
||||
public:
|
||||
/// Acquire this lock if you need the table structure to remain constant during the execution of
|
||||
|
Loading…
Reference in New Issue
Block a user