Browse Source

Update drogon (#5019)

* Update drogon

* Update the md5 of drogon
An Tao 6 years ago
parent
commit
3491bd7f96

+ 1 - 1
frameworks/C++/drogon/drogon-core.dockerfile

@@ -44,7 +44,7 @@ RUN git clone https://github.com/an-tao/drogon
 
 
 WORKDIR $DROGON_ROOT
 WORKDIR $DROGON_ROOT
 
 
-RUN git checkout 673d74191e30f406cce6dc7450c8d7e08ce30f66
+RUN git checkout ba49a0e0e623aa0d0bbfe669e34127850ade0b24
 RUN git submodule update --init
 RUN git submodule update --init
 RUN mkdir build
 RUN mkdir build
 
 

+ 1 - 1
frameworks/C++/drogon/drogon.dockerfile

@@ -44,7 +44,7 @@ RUN git clone https://github.com/an-tao/drogon
 
 
 WORKDIR $DROGON_ROOT
 WORKDIR $DROGON_ROOT
 
 
-RUN git checkout 673d74191e30f406cce6dc7450c8d7e08ce30f66
+RUN git checkout ba49a0e0e623aa0d0bbfe669e34127850ade0b24
 RUN git submodule update --init
 RUN git submodule update --init
 RUN mkdir build
 RUN mkdir build
 
 

+ 2 - 3
frameworks/C++/drogon/drogon_benchmark/main.cc

@@ -3,12 +3,11 @@
 
 
 int main(int argc, char const *argv[])
 int main(int argc, char const *argv[])
 {
 {
-    if(argc<2)
+    if (argc < 2)
     {
     {
         std::cout << "please input the config file name" << std::endl;
         std::cout << "please input the config file name" << std::endl;
         return -1;
         return -1;
     }
     }
-    drogon::app().loadConfigFile(argv[1]);
-    drogon::app().run();
+    drogon::app().loadConfigFile(argv[1]).run();
     return 0;
     return 0;
 }
 }

+ 37 - 38
frameworks/C++/drogon/drogon_benchmark/models/Fortune.cc

@@ -9,6 +9,7 @@
 #include <drogon/utils/Utilities.h>
 #include <drogon/utils/Utilities.h>
 #include <string>
 #include <string>
 
 
+using namespace drogon;
 using namespace drogon_model::hello_world;
 using namespace drogon_model::hello_world;
 
 
 const std::string Fortune::Cols::id = "id";
 const std::string Fortune::Cols::id = "id";
@@ -17,10 +18,9 @@ const std::string Fortune::primaryKeyName = "id";
 const bool Fortune::hasPrimaryKey = true;
 const bool Fortune::hasPrimaryKey = true;
 const std::string Fortune::tableName = "fortune";
 const std::string Fortune::tableName = "fortune";
 
 
-const std::vector<typename Fortune::MetaData> Fortune::_metaData={
-{"id","int32_t","integer",4,0,1,1},
-{"message","std::string","character varying",2048,0,0,1}
-};
+const std::vector<typename Fortune::MetaData> Fortune::_metaData = {
+    {"id", "int32_t", "integer", 4, 0, 1, 1},
+    {"message", "std::string", "character varying", 2048, 0, 0, 1}};
 const std::string &Fortune::getColumnName(size_t index) noexcept(false)
 const std::string &Fortune::getColumnName(size_t index) noexcept(false)
 {
 {
     assert(index < _metaData.size());
     assert(index < _metaData.size());
@@ -28,22 +28,24 @@ const std::string &Fortune::getColumnName(size_t index) noexcept(false)
 }
 }
 Fortune::Fortune(const Row &r) noexcept
 Fortune::Fortune(const Row &r) noexcept
 {
 {
-        if(!r["id"].isNull())
-        {
-            _id=std::make_shared<int32_t>(r["id"].as<int32_t>());
-        }
-        if(!r["message"].isNull())
-        {
-            _message=std::make_shared<std::string>(r["message"].as<std::string>());
-        }
+    if (!r["id"].isNull())
+    {
+        _id = std::make_shared<int32_t>(r["id"].as<int32_t>());
+    }
+    if (!r["message"].isNull())
+    {
+        _message =
+            std::make_shared<std::string>(r["message"].as<std::string>());
+    }
 }
 }
-const int32_t & Fortune::getValueOfId(const int32_t &defaultValue) const noexcept
+const int32_t &Fortune::getValueOfId() const noexcept
 {
 {
-    if(_id)
+    const static int32_t defaultValue = int32_t();
+    if (_id)
         return *_id;
         return *_id;
     return defaultValue;
     return defaultValue;
 }
 }
-std::shared_ptr<const int32_t> Fortune::getId() const noexcept
+const std::shared_ptr<int32_t> &Fortune::getId() const noexcept
 {
 {
     return _id;
     return _id;
 }
 }
@@ -53,19 +55,20 @@ void Fortune::setId(const int32_t &id) noexcept
     _dirtyFlag[0] = true;
     _dirtyFlag[0] = true;
 }
 }
 
 
-const typename Fortune::PrimaryKeyType & Fortune::getPrimaryKey() const
+const typename Fortune::PrimaryKeyType &Fortune::getPrimaryKey() const
 {
 {
     assert(_id);
     assert(_id);
     return *_id;
     return *_id;
 }
 }
 
 
-const std::string & Fortune::getValueOfMessage(const std::string &defaultValue) const noexcept
+const std::string &Fortune::getValueOfMessage() const noexcept
 {
 {
-    if(_message)
+    const static std::string defaultValue = std::string();
+    if (_message)
         return *_message;
         return *_message;
     return defaultValue;
     return defaultValue;
 }
 }
-std::shared_ptr<const std::string> Fortune::getMessage() const noexcept
+const std::shared_ptr<std::string> &Fortune::getMessage() const noexcept
 {
 {
     return _message;
     return _message;
 }
 }
@@ -80,23 +83,19 @@ void Fortune::setMessage(std::string &&message) noexcept
     _dirtyFlag[1] = true;
     _dirtyFlag[1] = true;
 }
 }
 
 
-
 void Fortune::updateId(const uint64_t id)
 void Fortune::updateId(const uint64_t id)
 {
 {
 }
 }
 
 
 const std::vector<std::string> &Fortune::insertColumns() noexcept
 const std::vector<std::string> &Fortune::insertColumns() noexcept
 {
 {
-    static const std::vector<std::string> _inCols={
-        "id",
-        "message"
-    };
+    static const std::vector<std::string> _inCols = {"id", "message"};
     return _inCols;
     return _inCols;
 }
 }
 
 
 void Fortune::outputArgs(drogon::orm::internal::SqlBinder &binder) const
 void Fortune::outputArgs(drogon::orm::internal::SqlBinder &binder) const
 {
 {
-    if(getId())
+    if (getId())
     {
     {
         binder << getValueOfId();
         binder << getValueOfId();
     }
     }
@@ -104,7 +103,7 @@ void Fortune::outputArgs(drogon::orm::internal::SqlBinder &binder) const
     {
     {
         binder << nullptr;
         binder << nullptr;
     }
     }
-    if(getMessage())
+    if (getMessage())
     {
     {
         binder << getValueOfMessage();
         binder << getValueOfMessage();
     }
     }
@@ -117,9 +116,9 @@ void Fortune::outputArgs(drogon::orm::internal::SqlBinder &binder) const
 const std::vector<std::string> Fortune::updateColumns() const
 const std::vector<std::string> Fortune::updateColumns() const
 {
 {
     std::vector<std::string> ret;
     std::vector<std::string> ret;
-    for(size_t i=0;i<sizeof(_dirtyFlag);i++)
+    for (size_t i = 0; i < sizeof(_dirtyFlag); i++)
     {
     {
-        if(_dirtyFlag[i])
+        if (_dirtyFlag[i])
         {
         {
             ret.push_back(getColumnName(i));
             ret.push_back(getColumnName(i));
         }
         }
@@ -129,9 +128,9 @@ const std::vector<std::string> Fortune::updateColumns() const
 
 
 void Fortune::updateArgs(drogon::orm::internal::SqlBinder &binder) const
 void Fortune::updateArgs(drogon::orm::internal::SqlBinder &binder) const
 {
 {
-    if(_dirtyFlag[0])
+    if (_dirtyFlag[0])
     {
     {
-        if(getId())
+        if (getId())
         {
         {
             binder << getValueOfId();
             binder << getValueOfId();
         }
         }
@@ -140,9 +139,9 @@ void Fortune::updateArgs(drogon::orm::internal::SqlBinder &binder) const
             binder << nullptr;
             binder << nullptr;
         }
         }
     }
     }
-    if(_dirtyFlag[1])
+    if (_dirtyFlag[1])
     {
     {
-        if(getMessage())
+        if (getMessage())
         {
         {
             binder << getValueOfMessage();
             binder << getValueOfMessage();
         }
         }
@@ -155,21 +154,21 @@ void Fortune::updateArgs(drogon::orm::internal::SqlBinder &binder) const
 Json::Value Fortune::toJson() const
 Json::Value Fortune::toJson() const
 {
 {
     Json::Value ret;
     Json::Value ret;
-    if(getId())
+    if (getId())
     {
     {
-        ret["id"]=getValueOfId();
+        ret["id"] = getValueOfId();
     }
     }
     else
     else
     {
     {
-        ret["id"]=Json::Value();
+        ret["id"] = Json::Value();
     }
     }
-    if(getMessage())
+    if (getMessage())
     {
     {
-        ret["message"]=getValueOfMessage();
+        ret["message"] = getValueOfMessage();
     }
     }
     else
     else
     {
     {
-        ret["message"]=Json::Value();
+        ret["message"] = Json::Value();
     }
     }
     return ret;
     return ret;
 }
 }

+ 27 - 21
frameworks/C++/drogon/drogon_benchmark/models/Fortune.h

@@ -19,13 +19,13 @@
 #include <tuple>
 #include <tuple>
 #include <stdint.h>
 #include <stdint.h>
 #include <iostream>
 #include <iostream>
+
 using namespace drogon::orm;
 using namespace drogon::orm;
 
 
 namespace drogon_model
 namespace drogon_model
 {
 {
-namespace hello_world 
+namespace hello_world
 {
 {
-
 class Fortune
 class Fortune
 {
 {
   public:
   public:
@@ -40,29 +40,35 @@ class Fortune
     const static bool hasPrimaryKey;
     const static bool hasPrimaryKey;
     const static std::string primaryKeyName;
     const static std::string primaryKeyName;
     typedef int32_t PrimaryKeyType;
     typedef int32_t PrimaryKeyType;
-    const PrimaryKeyType & getPrimaryKey() const;
-    Fortune(const Row &r) noexcept;
+    const PrimaryKeyType &getPrimaryKey() const;
+    explicit Fortune(const Row &r) noexcept;
     Fortune() = default;
     Fortune() = default;
-    
+
     /**  For column id  */
     /**  For column id  */
-    ///Get the value of the column id, returns the default value if the column is null
-    const int32_t &getValueOfId(const int32_t &defaultValue=int32_t()) const noexcept;
-    ///Returns a shared_ptr object pointing to the column const value, or an empty shared_ptr object if the column is null
-    std::shared_ptr<const int32_t> getId() const noexcept;
-    ///Set the value of the column id
+    /// Get the value of the column id, returns the default value if the column
+    /// is null
+    const int32_t &getValueOfId() const noexcept;
+    /// Return a shared_ptr object pointing to the column const value, or an
+    /// empty shared_ptr object if the column is null
+    const std::shared_ptr<int32_t> &getId() const noexcept;
+    /// Set the value of the column id
     void setId(const int32_t &id) noexcept;
     void setId(const int32_t &id) noexcept;
 
 
     /**  For column message  */
     /**  For column message  */
-    ///Get the value of the column message, returns the default value if the column is null
-    const std::string &getValueOfMessage(const std::string &defaultValue=std::string()) const noexcept;
-    ///Returns a shared_ptr object pointing to the column const value, or an empty shared_ptr object if the column is null
-    std::shared_ptr<const std::string> getMessage() const noexcept;
-    ///Set the value of the column message
+    /// Get the value of the column message, returns the default value if the
+    /// column is null
+    const std::string &getValueOfMessage() const noexcept;
+    /// Return a shared_ptr object pointing to the column const value, or an
+    /// empty shared_ptr object if the column is null
+    const std::shared_ptr<std::string> &getMessage() const noexcept;
+    /// Set the value of the column message
     void setMessage(const std::string &message) noexcept;
     void setMessage(const std::string &message) noexcept;
     void setMessage(std::string &&message) noexcept;
     void setMessage(std::string &&message) noexcept;
 
 
-
-    static size_t getColumnNumber() noexcept {  return 2;  }
+    static size_t getColumnNumber() noexcept
+    {
+        return 2;
+    }
     static const std::string &getColumnName(size_t index) noexcept(false);
     static const std::string &getColumnName(size_t index) noexcept(false);
 
 
     Json::Value toJson() const;
     Json::Value toJson() const;
@@ -73,7 +79,7 @@ class Fortune
     void outputArgs(drogon::orm::internal::SqlBinder &binder) const;
     void outputArgs(drogon::orm::internal::SqlBinder &binder) const;
     const std::vector<std::string> updateColumns() const;
     const std::vector<std::string> updateColumns() const;
     void updateArgs(drogon::orm::internal::SqlBinder &binder) const;
     void updateArgs(drogon::orm::internal::SqlBinder &binder) const;
-    ///For mysql only
+    /// For mysql or sqlite3
     void updateId(const uint64_t id);
     void updateId(const uint64_t id);
     std::shared_ptr<int32_t> _id;
     std::shared_ptr<int32_t> _id;
     std::shared_ptr<std::string> _message;
     std::shared_ptr<std::string> _message;
@@ -88,8 +94,8 @@ class Fortune
         const bool _notNull;
         const bool _notNull;
     };
     };
     static const std::vector<MetaData> _metaData;
     static const std::vector<MetaData> _metaData;
-    bool _dirtyFlag[2]={ false };
+    bool _dirtyFlag[2] = {false};
 };
 };
 
 
-} // namespace hello_world
-} // namespace drogon_model
+}  // namespace hello_world
+}  // namespace drogon_model

+ 37 - 38
frameworks/C++/drogon/drogon_benchmark/models/World.cc

@@ -9,6 +9,7 @@
 #include <drogon/utils/Utilities.h>
 #include <drogon/utils/Utilities.h>
 #include <string>
 #include <string>
 
 
+using namespace drogon;
 using namespace drogon_model::hello_world;
 using namespace drogon_model::hello_world;
 
 
 const std::string World::Cols::id = "id";
 const std::string World::Cols::id = "id";
@@ -17,10 +18,9 @@ const std::string World::primaryKeyName = "id";
 const bool World::hasPrimaryKey = true;
 const bool World::hasPrimaryKey = true;
 const std::string World::tableName = "world";
 const std::string World::tableName = "world";
 
 
-const std::vector<typename World::MetaData> World::_metaData={
-{"id","int32_t","integer",4,0,1,1},
-{"randomnumber","int32_t","integer",4,0,0,1}
-};
+const std::vector<typename World::MetaData> World::_metaData = {
+    {"id", "int32_t", "integer", 4, 0, 1, 1},
+    {"randomnumber", "int32_t", "integer", 4, 0, 0, 1}};
 const std::string &World::getColumnName(size_t index) noexcept(false)
 const std::string &World::getColumnName(size_t index) noexcept(false)
 {
 {
     assert(index < _metaData.size());
     assert(index < _metaData.size());
@@ -28,22 +28,24 @@ const std::string &World::getColumnName(size_t index) noexcept(false)
 }
 }
 World::World(const Row &r) noexcept
 World::World(const Row &r) noexcept
 {
 {
-        if(!r["id"].isNull())
-        {
-            _id=std::make_shared<int32_t>(r["id"].as<int32_t>());
-        }
-        if(!r["randomnumber"].isNull())
-        {
-            _randomnumber=std::make_shared<int32_t>(r["randomnumber"].as<int32_t>());
-        }
+    if (!r["id"].isNull())
+    {
+        _id = std::make_shared<int32_t>(r["id"].as<int32_t>());
+    }
+    if (!r["randomnumber"].isNull())
+    {
+        _randomnumber =
+            std::make_shared<int32_t>(r["randomnumber"].as<int32_t>());
+    }
 }
 }
-const int32_t & World::getValueOfId(const int32_t &defaultValue) const noexcept
+const int32_t &World::getValueOfId() const noexcept
 {
 {
-    if(_id)
+    const static int32_t defaultValue = int32_t();
+    if (_id)
         return *_id;
         return *_id;
     return defaultValue;
     return defaultValue;
 }
 }
-std::shared_ptr<const int32_t> World::getId() const noexcept
+const std::shared_ptr<int32_t> &World::getId() const noexcept
 {
 {
     return _id;
     return _id;
 }
 }
@@ -53,19 +55,20 @@ void World::setId(const int32_t &id) noexcept
     _dirtyFlag[0] = true;
     _dirtyFlag[0] = true;
 }
 }
 
 
-const typename World::PrimaryKeyType & World::getPrimaryKey() const
+const typename World::PrimaryKeyType &World::getPrimaryKey() const
 {
 {
     assert(_id);
     assert(_id);
     return *_id;
     return *_id;
 }
 }
 
 
-const int32_t & World::getValueOfRandomnumber(const int32_t &defaultValue) const noexcept
+const int32_t &World::getValueOfRandomnumber() const noexcept
 {
 {
-    if(_randomnumber)
+    const static int32_t defaultValue = int32_t();
+    if (_randomnumber)
         return *_randomnumber;
         return *_randomnumber;
     return defaultValue;
     return defaultValue;
 }
 }
-std::shared_ptr<const int32_t> World::getRandomnumber() const noexcept
+const std::shared_ptr<int32_t> &World::getRandomnumber() const noexcept
 {
 {
     return _randomnumber;
     return _randomnumber;
 }
 }
@@ -75,23 +78,19 @@ void World::setRandomnumber(const int32_t &randomnumber) noexcept
     _dirtyFlag[1] = true;
     _dirtyFlag[1] = true;
 }
 }
 
 
-
 void World::updateId(const uint64_t id)
 void World::updateId(const uint64_t id)
 {
 {
 }
 }
 
 
 const std::vector<std::string> &World::insertColumns() noexcept
 const std::vector<std::string> &World::insertColumns() noexcept
 {
 {
-    static const std::vector<std::string> _inCols={
-        "id",
-        "randomnumber"
-    };
+    static const std::vector<std::string> _inCols = {"id", "randomnumber"};
     return _inCols;
     return _inCols;
 }
 }
 
 
 void World::outputArgs(drogon::orm::internal::SqlBinder &binder) const
 void World::outputArgs(drogon::orm::internal::SqlBinder &binder) const
 {
 {
-    if(getId())
+    if (getId())
     {
     {
         binder << getValueOfId();
         binder << getValueOfId();
     }
     }
@@ -99,7 +98,7 @@ void World::outputArgs(drogon::orm::internal::SqlBinder &binder) const
     {
     {
         binder << nullptr;
         binder << nullptr;
     }
     }
-    if(getRandomnumber())
+    if (getRandomnumber())
     {
     {
         binder << getValueOfRandomnumber();
         binder << getValueOfRandomnumber();
     }
     }
@@ -112,9 +111,9 @@ void World::outputArgs(drogon::orm::internal::SqlBinder &binder) const
 const std::vector<std::string> World::updateColumns() const
 const std::vector<std::string> World::updateColumns() const
 {
 {
     std::vector<std::string> ret;
     std::vector<std::string> ret;
-    for(size_t i=0;i<sizeof(_dirtyFlag);i++)
+    for (size_t i = 0; i < sizeof(_dirtyFlag); i++)
     {
     {
-        if(_dirtyFlag[i])
+        if (_dirtyFlag[i])
         {
         {
             ret.push_back(getColumnName(i));
             ret.push_back(getColumnName(i));
         }
         }
@@ -124,9 +123,9 @@ const std::vector<std::string> World::updateColumns() const
 
 
 void World::updateArgs(drogon::orm::internal::SqlBinder &binder) const
 void World::updateArgs(drogon::orm::internal::SqlBinder &binder) const
 {
 {
-    if(_dirtyFlag[0])
+    if (_dirtyFlag[0])
     {
     {
-        if(getId())
+        if (getId())
         {
         {
             binder << getValueOfId();
             binder << getValueOfId();
         }
         }
@@ -135,9 +134,9 @@ void World::updateArgs(drogon::orm::internal::SqlBinder &binder) const
             binder << nullptr;
             binder << nullptr;
         }
         }
     }
     }
-    if(_dirtyFlag[1])
+    if (_dirtyFlag[1])
     {
     {
-        if(getRandomnumber())
+        if (getRandomnumber())
         {
         {
             binder << getValueOfRandomnumber();
             binder << getValueOfRandomnumber();
         }
         }
@@ -150,21 +149,21 @@ void World::updateArgs(drogon::orm::internal::SqlBinder &binder) const
 Json::Value World::toJson() const
 Json::Value World::toJson() const
 {
 {
     Json::Value ret;
     Json::Value ret;
-    if(getId())
+    if (getId())
     {
     {
-        ret["id"]=getValueOfId();
+        ret["id"] = getValueOfId();
     }
     }
     else
     else
     {
     {
-        ret["id"]=Json::Value();
+        ret["id"] = Json::Value();
     }
     }
-    if(getRandomnumber())
+    if (getRandomnumber())
     {
     {
-        ret["randomnumber"]=getValueOfRandomnumber();
+        ret["randomnumber"] = getValueOfRandomnumber();
     }
     }
     else
     else
     {
     {
-        ret["randomnumber"]=Json::Value();
+        ret["randomnumber"] = Json::Value();
     }
     }
     return ret;
     return ret;
 }
 }

+ 27 - 21
frameworks/C++/drogon/drogon_benchmark/models/World.h

@@ -19,13 +19,13 @@
 #include <tuple>
 #include <tuple>
 #include <stdint.h>
 #include <stdint.h>
 #include <iostream>
 #include <iostream>
+
 using namespace drogon::orm;
 using namespace drogon::orm;
 
 
 namespace drogon_model
 namespace drogon_model
 {
 {
-namespace hello_world 
+namespace hello_world
 {
 {
-
 class World
 class World
 {
 {
   public:
   public:
@@ -40,28 +40,34 @@ class World
     const static bool hasPrimaryKey;
     const static bool hasPrimaryKey;
     const static std::string primaryKeyName;
     const static std::string primaryKeyName;
     typedef int32_t PrimaryKeyType;
     typedef int32_t PrimaryKeyType;
-    const PrimaryKeyType & getPrimaryKey() const;
-    World(const Row &r) noexcept;
+    const PrimaryKeyType &getPrimaryKey() const;
+    explicit World(const Row &r) noexcept;
     World() = default;
     World() = default;
-    
+
     /**  For column id  */
     /**  For column id  */
-    ///Get the value of the column id, returns the default value if the column is null
-    const int32_t &getValueOfId(const int32_t &defaultValue=int32_t()) const noexcept;
-    ///Returns a shared_ptr object pointing to the column const value, or an empty shared_ptr object if the column is null
-    std::shared_ptr<const int32_t> getId() const noexcept;
-    ///Set the value of the column id
+    /// Get the value of the column id, returns the default value if the column
+    /// is null
+    const int32_t &getValueOfId() const noexcept;
+    /// Return a shared_ptr object pointing to the column const value, or an
+    /// empty shared_ptr object if the column is null
+    const std::shared_ptr<int32_t> &getId() const noexcept;
+    /// Set the value of the column id
     void setId(const int32_t &id) noexcept;
     void setId(const int32_t &id) noexcept;
 
 
     /**  For column randomnumber  */
     /**  For column randomnumber  */
-    ///Get the value of the column randomnumber, returns the default value if the column is null
-    const int32_t &getValueOfRandomnumber(const int32_t &defaultValue=int32_t()) const noexcept;
-    ///Returns a shared_ptr object pointing to the column const value, or an empty shared_ptr object if the column is null
-    std::shared_ptr<const int32_t> getRandomnumber() const noexcept;
-    ///Set the value of the column randomnumber
+    /// Get the value of the column randomnumber, returns the default value if
+    /// the column is null
+    const int32_t &getValueOfRandomnumber() const noexcept;
+    /// Return a shared_ptr object pointing to the column const value, or an
+    /// empty shared_ptr object if the column is null
+    const std::shared_ptr<int32_t> &getRandomnumber() const noexcept;
+    /// Set the value of the column randomnumber
     void setRandomnumber(const int32_t &randomnumber) noexcept;
     void setRandomnumber(const int32_t &randomnumber) noexcept;
 
 
-
-    static size_t getColumnNumber() noexcept {  return 2;  }
+    static size_t getColumnNumber() noexcept
+    {
+        return 2;
+    }
     static const std::string &getColumnName(size_t index) noexcept(false);
     static const std::string &getColumnName(size_t index) noexcept(false);
 
 
     Json::Value toJson() const;
     Json::Value toJson() const;
@@ -72,7 +78,7 @@ class World
     void outputArgs(drogon::orm::internal::SqlBinder &binder) const;
     void outputArgs(drogon::orm::internal::SqlBinder &binder) const;
     const std::vector<std::string> updateColumns() const;
     const std::vector<std::string> updateColumns() const;
     void updateArgs(drogon::orm::internal::SqlBinder &binder) const;
     void updateArgs(drogon::orm::internal::SqlBinder &binder) const;
-    ///For mysql only
+    /// For mysql or sqlite3
     void updateId(const uint64_t id);
     void updateId(const uint64_t id);
     std::shared_ptr<int32_t> _id;
     std::shared_ptr<int32_t> _id;
     std::shared_ptr<int32_t> _randomnumber;
     std::shared_ptr<int32_t> _randomnumber;
@@ -87,8 +93,8 @@ class World
         const bool _notNull;
         const bool _notNull;
     };
     };
     static const std::vector<MetaData> _metaData;
     static const std::vector<MetaData> _metaData;
-    bool _dirtyFlag[2]={ false };
+    bool _dirtyFlag[2] = {false};
 };
 };
 
 
-} // namespace hello_world
-} // namespace drogon_model
+}  // namespace hello_world
+}  // namespace drogon_model