sql-builder icon indicating copy to clipboard operation
sql-builder copied to clipboard

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

Open AmdRyZen opened this issue 1 year ago • 1 comments

可以支持占位符吗

AmdRyZen avatar May 25 '24 13:05 AmdRyZen

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)");

mkfyi avatar Sep 28 '24 23:09 mkfyi