Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escaping ? doesn't work #461

Open
SitharaNA opened this issue Apr 5, 2021 · 1 comment
Open

Escaping ? doesn't work #461

SitharaNA opened this issue Apr 5, 2021 · 1 comment

Comments

@SitharaNA
Copy link

SitharaNA commented Apr 5, 2021

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

@ahmad-moussawi
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants