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 read the converted sql string #179

Closed
wuzhenda opened this issue May 27, 2022 · 1 comment
Closed

how to read the converted sql string #179

wuzhenda opened this issue May 27, 2022 · 1 comment

Comments

@wuzhenda
Copy link

is there a way to find out how the language converted to the final sql string?

for example:

  var queryParams = new 
    {
        FirstName = "John",
        Street = "Creek Street"
    };

    var persons = dbConnection.Find<Person>(statement => statement
        .WithAlias("person")
        .Include<Address>(join => join.InnerJoin()
                                      .WithAlias("address"))
        .Where($@"
           {nameof(Person.FirstName):of person} = {nameof(queryParams.FirstName):P} 
           AND {nameof(Address.Street):of address} = {nameof(queryParams.Street):P}")  
        .OrderBy($"{nameof(Person.LastName):of person} DESC")  
        .Skip(10)  
        .Top(20)  
        .WithParameters(queryParams);

what the code above finally convert to the sql string , can we debug to see the sql string?
most of the time sql string is easy to read & write, but how to convert the two language?

as I mentioned https://github.com/MoonStorm/FastCrud/issues/178
the fastcrud is not user friendly enough.

@MoonStorm
Copy link
Owner

FastCrud lives on top of Dapper which lives on top of ADO.NET. You can use the regular tracing tools in your favorite IDE for capturing ADO.NET events. As the last resort you can also profile the TSQL that goes through your favorite database server.

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