-
-
Notifications
You must be signed in to change notification settings - Fork 861
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 get full used query ? #1068
Comments
I think this not yet supported/possible. Will review the code and I guess this can be considered as enhancement. Thanks! |
Would just like to point out that you can get the most recent queries from laravel itself. And since version 5.0 (I think) this is disabled by default, so you can just do \DB::enableQueryLog();
$table = Datatables::of($query) {
// etc.
}
$log = \DB::getQueryLog(); |
Implemented on master branch and will be available on Laravel 5.5. But we can also implement on Laravel 5.4 version if needed. $dataTable = Datatables::of(App\User::query());
$response = $dataTable->make(true);
$query = $dataTable->getQuery()->get();
return $response; |
Thank you for this new feature. Can you please implement also on Laravel 5.4 ? I see that 5.5 is major release and my project is not tested yet for 5.5 Thank you again. |
@yajra can we have the last used query without the limit? , currently i get something like $query = $dataTable->getQuery()->toSql();
Log::info($query);
//select distinct CONCAT(users.name,' ',IFNULL(users.surname, '')) as username,
// `users`.`id`, `users`.`country`
// , `users`.`email`
// from `users`
// left join `registrants` on `users`.`id` = `registrants`.`users_id`
// limit 10 offset 10 but i want to run without the |
@fricred maybe |
I did try the same to get queries logged but no success. but as default behavior, after all the custom processing we just pass the query builder to the data table and Datatables::of($posts) apply filter with in the method and draw the table. Any help will be appriciable. |
It is possible to get full query of Datatables on filter ? I want to make a custom csv export. Something like $datatables->getQuery() ?
The text was updated successfully, but these errors were encountered: