RT,作为 C++ 的初学者,写了一个简单的小工具。 DELETE 语句可以写成:
Condition *passwordCondition = new Condition();
passwordCondition->field(new string("password"))->ship(Ship::NOT_EXISTED);
Where *where = new Where();
where->condition(passwordCondition);
Delete *aDelete = new Delete();
aDelete->table(new string("user"))->where(where);
cout << *aDelete->toString() << endl;
output
DELETE FROM user
WHERE (`password` IS NULL)
github 地址: https://github.com/yemingfeng/csql
|  |      1misaka19000      2018-11-18 21:14:26 +08:00 via Android 资瓷 | 
|  |      21010543618      2018-11-18 22:04:38 +08:00 | 
|      3Aidenboss OP @1010543618 现在只生成了 SQL 语句哈,可以准备和 MySQL Client 配合使用了。感谢提供的参考文档~ | 
|  |      4Kilerd      2018-11-18 22:42:24 +08:00 考虑下在 readme 里面吧代码块加上 语言标志,不然没有代码高亮 | 
|  |      6lwh0328      2018-11-19 00:05:18 +08:00 同样在学 C++,一起加油哦! | 
|  |      7shoujiaxin      2018-11-19 08:00:50 +08:00 via iPhone main 里 new 的指针好像都没有 delete ?还是用 shared_ptr 吧 | 
|      8Aidenboss OP @shoujiaxin 好的好的,确实没有 delete,老师教的都忘记了。过会儿补上。顺便学习下 shared_ptr。 | 
|      9lqxandxy      2018-11-19 14:06:42 +08:00 要 c++11 吗? 还是 c++98 就可以用了 |