FastCrud icon indicating copy to clipboard operation
FastCrud copied to clipboard

how to read the converted sql string

Open wuzhenda opened this issue 3 years ago • 0 comments

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.

wuzhenda avatar May 27 '22 03:05 wuzhenda