querybuilder icon indicating copy to clipboard operation
querybuilder copied to clipboard

Escaping ? doesn't work

Open SitharaNA opened this issue 3 years ago • 1 comments

I have a RAW sql that would pivot rows as columns and most of these have special characters for instance columns with period or questionmark dont work var query = new Query("dbo.Table"); query.Select("Column .."); produces SELECT [Column ].[].[] FROM [dbo].[Table] Using SelectRaw worked here but columns with question mark errors out since it's used to parameterize. var query = new Query("dbo.Table"); query.Select("Column ?");

Can these characters be escaped so that the sqlkata would ignore then?

I'm unable to override protected virtual string parameterPlaceholder { get; set; } = "?"; Due to magic string in CompileRaw method i.e ctx.RawSql = Helper.ExpandParameters(ctx.RawSql, "?", ctx.Bindings.ToArray());

SitharaNA avatar Apr 05 '21 11:04 SitharaNA

@SitharaNA do you mind adding a failed test case as PR?

ahmad-moussawi avatar Feb 10 '22 21:02 ahmad-moussawi