创建.删除,更新,获取数据库命令

时间:2021-11-21 03:20:53

创建数据库:

const std::string createImMessageIndex =
 "CREATE UNIQUE INDEX IF NOT EXISTS sessionid_idx ON immessage(msgId DESC,sessionId);";

删除条数:

const std::string DeleteMessageBySId
+ = "delete from immessage2 where msgId = ? and sessionid = ?";

更新:
const std::string UpdateMessageFileUrlBySId
= "update immessage set orifileurl = ? where msgId = ? and sessionid =?";

全清:
const std::string ClearAllChatMessage
= "delete from immessage";

获取全部信息:

const std::string CalculateMessageChartSize

 = "select * from immessage";