Skip to content

Don't add selecting of all fields if not needed #10

@lespavl

Description

@lespavl

I'm using Postgresql and have the following code:

$items = Element::select(DB::raw("COUNT(1), category"))->groupBy('category')->get();

Mysql processes this query without any problems, but in case of Postgresql I'm getting an error:

column "id" must appear in the GROUP BY clause or be used in an aggregate function

That's because your package adds extra select elements.* and Postgresql works in such way, that I need to specify, what to do with each selected field.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions