26 namespace schema_generator {
32 auto_increment_(false),
33 auto_increment_base_(0)
39 allow_null_(allow_null),
40 auto_increment_(false),
41 auto_increment_base_(0)
47 allow_null_(allow_null),
48 auto_increment_(auto_increment),
49 auto_increment_base_(auto_increment_base)
56 allow_null_(src.allow_null_),
57 auto_increment_(src.auto_increment_),
58 auto_increment_base_(src.auto_increment_base_)
76 std::string column_string =
"";
78 column_string +=
name_ +
" ";
79 switch(db_session->get_db_mode()) {
81 column_string += this->
type_->print(db_session) +
" PRIMARY KEY AUTOINCREMENT";
85 column_string += this->
type_->print(db_session) +
" AUTO_INCREMENT";
88 column_string +=
"BIGSERIAL";
91 utility_exit_with_message(
"ERROR:Please specify the database mode using -inout::dbms::mode. Valid options are: 'sqlite3', 'mysql', or 'postgres'");
94 column_string += this->
name_ +
" " + this->
type_->print(db_session);
98 column_string +=
" NOT NULL";
100 return column_string;
104 return (this->
name_.compare(other.
name()) == 0);
#define utility_exit_with_message(m)
Exit with file + line + message.
std::string print(utility::sql_database::sessionOP db_session) const
platform::Size auto_increment_base_
Program exit functions and macros.
bool operator==(const Column &other) const
bool auto_increment() const
Column class for the schema generator framework.
Size auto_increment_base() const
rule< Scanner, string_closure::context_t > name
Column(std::string name, DbDataTypeOP type)
pointer::shared_ptr< session > sessionOP
utility::pointer::shared_ptr< DbDataType > DbDataTypeOP