dbextensions

Get raw sql statement with DbExtensions SqlBuilder

别等时光非礼了梦想. 提交于 2020-01-17 07:52:27
问题 I'm using the SqlBuilder to build a dynamic sql statement where the SELECT and WHERE clauses vary. The query is built like this: SqlBuilder sb = new SqlBuilder(); sb.SELECT("id, name"); sb.FROM("products"); sb.WHERE("name LIKE {0}", new object[] { "a%" }); Once I've got the SqlBuilder ready, I would like to get the raw sql statement. However, the ToString() method returns a string which might look like this: SELECT id, name FROM products WHERE name LIKE {0} I need the raw sql with the