use raw pointer of table in class column (progress, needs fixes in tests)
This commit is contained in:
@@ -18,7 +18,7 @@ column operator ""_col(const char *name, const size_t len) {
|
||||
throw std::invalid_argument("Invalid column name: multiple dots found");
|
||||
}
|
||||
|
||||
return column{std::make_shared<table>(str.substr(0, pos)), str.substr(pos + 1)};
|
||||
return column{new table(str.substr(0, pos)), str.substr(pos + 1)};
|
||||
}
|
||||
|
||||
column::column(const char *name, const std::string& as)
|
||||
@@ -26,17 +26,15 @@ column::column(const char *name, const std::string& as)
|
||||
{}
|
||||
|
||||
column::column(std::string name, std::string as)
|
||||
: table_(std::make_shared<query::table>())
|
||||
, name_(std::move(name))
|
||||
: name_(std::move(name))
|
||||
, alias_(std::move(as)) {}
|
||||
|
||||
column::column(const sql::sql_function_t func, std::string name)
|
||||
: table_(std::make_shared<query::table>())
|
||||
, name_(std::move(name))
|
||||
: name_(std::move(name))
|
||||
, function_(func) {}
|
||||
|
||||
column::column(const std::shared_ptr<query::table>& t, std::string name, std::string as)
|
||||
: table_(t)
|
||||
column::column(const class table* tab, std::string name, std::string as)
|
||||
: table_(tab)
|
||||
, name_(std::move(name))
|
||||
, alias_(std::move(as)) {
|
||||
}
|
||||
@@ -85,12 +83,12 @@ bool column::has_alias() const {
|
||||
return !alias_.empty();
|
||||
}
|
||||
|
||||
std::shared_ptr<table> column::table() const {
|
||||
const class table* column::table() const {
|
||||
return table_;
|
||||
}
|
||||
|
||||
void column::table( const std::shared_ptr<query::table>& t ) {
|
||||
table_ = t;
|
||||
void column::table(const query::table* tab) {
|
||||
table_ = tab;
|
||||
}
|
||||
|
||||
column::operator const std::string&() const {
|
||||
|
||||
Reference in New Issue
Block a user