Skip to content

Sql::orderBy doesn't quote columns #84

@mrsoto

Description

@mrsoto

I've this query which does not quote columns and then mysql retrieve an incorrect order. The table has timestamp column

$mapper->news->fetchAll(Sql::orderBy('timestamp', 'id')->desc()->limit($initial, $pageSize))

Resulting query:

SELECT news.* FROM news ORDER BY timestamp, id DESC LIMIT 0, 200

expected:

SELECT news.* FROM news ORDER BY `timestamp`, `id` DESC LIMIT 0, 200

Is there a way to instruct Sql to quote columns?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions