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

How to join to CONTAINSTABLE? Do we need JoinRaw? #375

Open
mrfoster opened this issue May 13, 2020 · 2 comments
Open

How to join to CONTAINSTABLE? Do we need JoinRaw? #375

mrfoster opened this issue May 13, 2020 · 2 comments
Labels
verified_next_release Verified and will be solved in the next minor release

Comments

@mrfoster
Copy link

CONTAINSTABLE is being escaped when I'm trying to use join. It seems like a JoinRaw option would be appropriate here?

var query = new Query("Activity as a")
    .Join("CONTAINSTABLE(Activity, *, @query) as s", "a.Id", "s.Key")
    .OrderByDesc("s.Rank")
SELECT
  *
FROM
  [Activity] AS [a]
  INNER JOIN [CONTAINSTABLE(Activity, *, @query)] AS [s] ON [a].[Id] = [s].[Key]
ORDER BY
  [s].[Rank] DESC

I really want it to output:

SELECT
  *
FROM
  [Activity] AS [a]
  INNER JOIN CONTAINSTABLE(Activity, *, @query) AS [s] ON [a].[Id] = [s].[Key]
ORDER BY
  [s].[Rank] DESC

Is there a current workaround for this?

@ahmad-moussawi
Copy link
Contributor

Currently there is no support for XJoinRaw methods, but you can use the FromRaw to achieve this,
Check this example on SqlKata Playground

@ahmad-moussawi ahmad-moussawi added the verified_next_release Verified and will be solved in the next minor release label Mar 15, 2021
@ahmad-moussawi
Copy link
Contributor

#128 #475

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
verified_next_release Verified and will be solved in the next minor release
Projects
None yet
Development

No branches or pull requests

2 participants