added date_type_t, time_type_t and timestamp, ensure allocated postgres resources are released, split repository into basic_repository and repository.
This commit is contained in:
@@ -15,7 +15,7 @@ std::string restriction::column_name() const {
|
||||
return attr_.name();
|
||||
}
|
||||
std::shared_ptr<object> restriction::owner() const {
|
||||
return owner_;
|
||||
return owner_.lock();
|
||||
}
|
||||
|
||||
bool restriction::is_primary_key_constraint() const {
|
||||
@@ -30,12 +30,14 @@ bool restriction::is_unique_constraint() const {
|
||||
return utils::is_constraint_set(options_, utils::constraints::Unique);
|
||||
}
|
||||
|
||||
const std::string& restriction::ref_table_name() const {
|
||||
return reference_->name();
|
||||
std::string restriction::ref_table_name() const {
|
||||
const auto ref = reference_.lock();
|
||||
return ref ? ref->name() : "";
|
||||
}
|
||||
|
||||
const std::string& restriction::ref_column_name() const {
|
||||
return reference_->primary_key_attribute()->name();
|
||||
std::string restriction::ref_column_name() const {
|
||||
const auto ref = reference_.lock();
|
||||
return ref ? ref->primary_key_attribute()->name() : "";
|
||||
}
|
||||
|
||||
std::ostream & operator<<(std::ostream &os, const class restriction &c) {
|
||||
@@ -58,43 +60,4 @@ std::string restriction::type_string() const {
|
||||
}
|
||||
return "Unknown";
|
||||
}
|
||||
|
||||
// constraint_builder & constraint_builder::constraint(std::string name) {
|
||||
// constraint_name = std::move(name);
|
||||
// return *this;
|
||||
// }
|
||||
//
|
||||
// constraint_builder & constraint_builder::primary_key(std::string name) {
|
||||
// column_name = std::move(name);
|
||||
// options_ |= utils::constraints::PrimaryKey;
|
||||
// return *this;
|
||||
// }
|
||||
//
|
||||
// constraint_builder & constraint_builder::foreign_key(std::string name) {
|
||||
// column_name = std::move(name);
|
||||
// options_ |= utils::constraints::ForeignKey;
|
||||
// return *this;
|
||||
// }
|
||||
//
|
||||
// constraint_builder & constraint_builder::references(std::string table, std::string column) {
|
||||
// ref_table_name = std::move(table);
|
||||
// ref_column_name = std::move(column);
|
||||
//
|
||||
// return *this;
|
||||
// }
|
||||
//
|
||||
// constraint_builder::operator class restriction() const {
|
||||
// class restriction c;
|
||||
// c.name_ = constraint_name;
|
||||
// c.attr_ = column_name;
|
||||
// c.options_ = options_;
|
||||
// c.ref_column_name_ = ref_column_name;
|
||||
// c.ref_table_name_ = ref_table_name;
|
||||
// return c;
|
||||
// }
|
||||
//
|
||||
// constraint_builder constraint(std::string name) {
|
||||
// constraint_builder builder;
|
||||
// return builder.constraint(std::move(name));
|
||||
// }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user