The db.Select<T>()
API should only by used for SQL SELECT statements.
The db.SqlList<T>()
API should be used for non-SELECT queries, e.g:
using (var db = DbConnection)
{
var cnt = db.SqlList<MyWithCteObj>(
"WITH w_cnt AS (SELECT 5 AS cnt, 'me' AS name) SELECT cnt, name FROM w_cnt");
}
See the docs for more custom SQL APIs examples.