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

Order by nulls last produces sql error under postgres #1738

Closed
BARNZ opened this issue May 13, 2018 · 3 comments
Closed

Order by nulls last produces sql error under postgres #1738

BARNZ opened this issue May 13, 2018 · 3 comments

Comments

@BARNZ
Copy link

BARNZ commented May 13, 2018

Summary of problem or feature request

When orderByNullsLast is used is appears as though column identifiers are not escaped properly.

For example a user table that has a column named order and trying to do the following results in the column order not being escaped and a sql error when sorting by this order column

return datatables(User::query())
            ->orderByNullsLast()
            ->make(true);

Removing orderByNullsLast makes the query work as expected.

System details

  • Operating System - Windows 10
  • PHP Version - 7.2
  • Laravel Version - 5.6
  • Laravel-Datatables Version - 8.5.1
  • Database - PostgreSQL 10
@yajra
Copy link
Owner

yajra commented May 15, 2018

Working fine for me on mysql. Maybe try updating datatables.php config to fit your need?

'nulls_last_sql' => '%s %s NULLS LAST',

@github-actions
Copy link

github-actions bot commented Sep 7, 2023

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the stale label Sep 7, 2023
@github-actions
Copy link

This issue was closed because it has been inactive for 7 days since being marked as stale.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants