⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 updatequery.cpp

📁 LiteSQL is a C++ library that integrates C++ objects tightly to relational database and thus provide
💻 CPP
字号:
/* LiteSQL - UpdateQuery implementation *  * By Tero Laitinen  *  * See LICENSE for copyright information. */#include "compatibility.hpp"#include "litesql/updatequery.hpp"namespace litesql {using namespace std;UpdateQuery& UpdateQuery::where(const Expr& e) {    _where = (RawExpr(_where) && e).asString();    return *this;}UpdateQuery& UpdateQuery::set(FieldType f, string value) {    fields.push_back(f.name());    values.push_back(escapeSQL(value));    return *this;}UpdateQuery::operator string() const {    string q = "UPDATE " + table + " SET ";    Split sets;    for (size_t i = 0; i < fields.size(); i++)        sets.push_back(fields[i] + "=" + values[i]);    q += sets.join(",");    if (_where.size())        q += " WHERE " + _where;    return q;}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -