diff options
author | Sadie Powell <sadie@witchery.services> | 2024-08-14 02:40:48 +0100 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2024-08-14 05:47:55 +0100 |
commit | 528b5938ec71abed396248cf5e00f346e685aaea (patch) | |
tree | e923fed32be3fb62f946d44c633cd85ce855550b /include/modules/sql.h | |
parent | 03bee1706383d2766923e5d8edbb90d7ad1948b6 (diff) |
Automatically determine SQL column type from the field.
Also add more column types to ensure we are storing data in the
best format in the database.
Diffstat (limited to 'include/modules/sql.h')
-rw-r--r-- | include/modules/sql.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/modules/sql.h b/include/modules/sql.h index 8818a5130..8ff5efc7c 100644 --- a/include/modules/sql.h +++ b/include/modules/sql.h @@ -19,7 +19,7 @@ namespace SQL public: typedef std::map<Anope::string, std::stringstream *> Map; Map data; - std::map<Anope::string, Type> types; + std::map<Anope::string, Serialize::DataType> types; ~Data() { @@ -60,17 +60,17 @@ namespace SQL this->data.clear(); } - void SetType(const Anope::string &key, Type t) override + void SetType(const Anope::string &key, Serialize::DataType dt) override { - this->types[key] = t; + this->types[key] = dt; } - Type GetType(const Anope::string &key) const override + Serialize::DataType GetType(const Anope::string &key) const override { - std::map<Anope::string, Type>::const_iterator it = this->types.find(key); + auto it = this->types.find(key); if (it != this->types.end()) return it->second; - return DT_TEXT; + return Serialize::DataType::TEXT; } }; |