C# Sql Code check against schema

Hello, 

I have somehow configured my sql queries that are stored in c# variables to validate against the database schemas.

This is a very useful feature that I would like my team to use, I just have no idea how I set it

Please can you confirm

Kind regards

Mark

3 comments
Comment actions Permalink

Hello Mark,

I assume you've made use of the Language injections feature (Alt+Enter -> Mark as injected language or reference -> SQL). 

These blog posts might also be of help:

https://blog.jetbrains.com/dotnet/2020/03/05/working-databases-jetbrains-rider/

https://blog.jetbrains.com/dotnet/2018/10/29/sql-inside-c-strings-fragment-editor-run-query-console-language-injection-updates-rider-2018-3/

If the articles doesn't answer your questions, please describe the problem in more details. I'd be happy to help!

0
Comment actions Permalink

Hi Julia,

I think the issue is that we are using MySQL and Rider defaults to SQL.

I've managed to get it working globally for my colleagues with the following change, which feels like a hack

File, Settings, Editor, Language injections, edit “"SQL in C# (select/delete/insert/update/create)" and change the Language id from SQL (SQL) to MySQL (SQL)

My PC isn't set this way, it seems to have MySQL set as the default, I think I may have set this in a Global Dialect setting some time back, but I have no idea how to configure this for my colleagues

Any help would be appreciated

Mark

0
Comment actions Permalink

Mark,

Please try to configure the SQL dialect for your colleagues via `File -> Settings -> Language & Frameworks -> SQL Dialects`:

0

Please sign in to leave a comment.