强化SQL
This commit is contained in:
@@ -71,6 +71,9 @@ namespace ylib::mysql
|
||||
double get_double(uint32 index);
|
||||
double get_double(const std::string& name);
|
||||
|
||||
ylib::buffer get_blob(uint32 index);
|
||||
ylib::buffer get_blob(const std::string& name);
|
||||
|
||||
ylib::json to_json();
|
||||
|
||||
private:
|
||||
@@ -95,7 +98,8 @@ namespace ylib::mysql
|
||||
void set_uint64(uint32 index, uint64 value);
|
||||
void set_null(uint32 index);
|
||||
void set_string(uint32 index, const std::string& value);
|
||||
void set_blob(uint32 index, const ylib::buffer& value);
|
||||
void set_string(uint32 index,const char* data,int size);
|
||||
void set_blob(uint32 index, const char* data, int size);
|
||||
void clear();
|
||||
uint64 update();
|
||||
ylib::mysql::result* query();
|
||||
@@ -104,6 +108,8 @@ namespace ylib::mysql
|
||||
private:
|
||||
ylib::mysql::result* m_result = nullptr;
|
||||
void* m_handle = nullptr;
|
||||
|
||||
std::queue<std::shared_ptr<std::istringstream>> m_blobs;
|
||||
};
|
||||
class conn :public ylib::example<ylib::mysql::mysql_conn_info>, public ylib::error_base
|
||||
{
|
||||
|
||||
@@ -99,8 +99,9 @@ namespace ylib
|
||||
/// <param name="orderby"></param>
|
||||
/// <param name="limit"></param>
|
||||
void make_sql(std::string& field_name, std::string& where, std::string& orderby, std::string& limit, std::vector<std::any>& insert_values);
|
||||
private:
|
||||
public:
|
||||
mysql::conn* m_conn = nullptr;
|
||||
private:
|
||||
std::vector<ylib::where> m_wheres;
|
||||
std::string m_table_name;
|
||||
std::vector<std::string> m_fields;
|
||||
@@ -173,7 +174,9 @@ namespace ylib
|
||||
/// <param name="limit"></param>
|
||||
void make_sql(std::string& set, std::string& where, std::string& orderby, std::string& limit, std::vector<std::any>& insert_values);
|
||||
private:
|
||||
public:
|
||||
mysql::conn* m_conn = nullptr;
|
||||
private:
|
||||
std::vector<ylib::where> m_wheres;
|
||||
std::string m_table_name;
|
||||
std::vector<struct ylib::update::set> m_sets;
|
||||
@@ -205,8 +208,9 @@ namespace ylib
|
||||
uint64 exec();
|
||||
|
||||
void clear();
|
||||
private:
|
||||
public:
|
||||
mysql::conn* m_conn = nullptr;
|
||||
private:
|
||||
std::string m_table_name;
|
||||
std::vector<keyvalue> m_sets;
|
||||
};
|
||||
@@ -261,8 +265,9 @@ namespace ylib
|
||||
/// <param name="orderby"></param>
|
||||
/// <param name="limit"></param>
|
||||
void make_sql(std::string& where, std::string& orderby, std::string& limit, std::vector<std::any>& insert_values);
|
||||
private:
|
||||
public:
|
||||
mysql::conn* m_conn = nullptr;
|
||||
private:
|
||||
std::vector<ylib::where> m_wheres;
|
||||
std::string m_table_name;
|
||||
ylib::limit m_limit;
|
||||
|
||||
@@ -24,7 +24,6 @@ namespace ylib {
|
||||
if(example == NULL)
|
||||
return;
|
||||
((ylib::example_core*)example)->recover();
|
||||
|
||||
std::unique_lock<std::mutex> sp(m_mutex);
|
||||
m_pop_size--;
|
||||
m_queue.push(example);
|
||||
@@ -40,9 +39,9 @@ namespace ylib {
|
||||
};
|
||||
enum EXAMPLE_START_RESULT
|
||||
{
|
||||
SR_SUCCESS,
|
||||
SR_TIMEOUT,
|
||||
SR_FAILED,
|
||||
SR_SUCCESS
|
||||
};
|
||||
template<typename INFO>
|
||||
class example:public example_core
|
||||
|
||||
Reference in New Issue
Block a user