six-ddc / sql-builder

SQL query string builder for C++11
MIT License
123 stars 36 forks source link

builder.Equal("site_id", "?"), #9

Open AmdRyZen opened 5 months ago

AmdRyZen commented 5 months ago

可以支持占位符吗

mkfyi commented 1 month ago

https://github.com/six-ddc/sql-builder/blob/master/README.md?plain=1#L69

// Update with positional parameters
UpdateModel uP;
Param mark = "?";
uP.update("user")
    .set("name", mark)
        ("age", mark)
        ("score", mark)
        ("address", mark)
    .where(column("id").in(a));
assert(uP.str() ==
        "update user set name = ?, age = ?, score = ?, address = ? where id in (1, 2, 3)");