Skip to content

Commit

Permalink
feat: add read_only attribute for columns.
Browse files Browse the repository at this point in the history
  • Loading branch information
ashigeru committed Jul 22, 2024
1 parent 2febb2a commit c82c2c3
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions include/yugawara/storage/column_feature.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,24 @@ namespace yugawara::storage {
enum class column_feature {
/**
* @brief the target column is defined by the system (NOT explicitly defined by a user).
* @details users must not treat these columns directly.
* @details users cannot access these columns.
*/
synthesized = 0,

/**
* @brief the target column is hidden from the user.
* @details hidden columns are ignored the following operations:
* @details these columns are ignored the following operations:
* - `SELECT *`
* - `NATURAL JOIN`, and similar column name based matching (e.g. `UNION CORRESPONDING`)
*/
hidden = 1,

/**
* @brief the target column is read-only.
* @details The read-only columns are created or update only with its default value.
* @attention The compiler does not treat this feature.
*/
read_only = 2,
};

/**
Expand All @@ -36,7 +43,7 @@ enum class column_feature {
using column_feature_set = ::takatori::util::enum_set<
column_feature,
column_feature::synthesized,
column_feature::hidden>;
column_feature::read_only>;

/**
* @brief returns string representation of the value.
Expand All @@ -49,6 +56,7 @@ inline constexpr std::string_view to_string_view(column_feature value) noexcept
switch (value) {
case kind::synthesized: return "synthesized"sv;
case kind::hidden: return "hidden"sv;
case kind::read_only: return "read_only"sv;
}
std::abort();
}
Expand Down

0 comments on commit c82c2c3

Please sign in to comment.