Skip to content

where_raw bindings parameter not used #18

@circulon

Description

@circulon

Migrated from: MasoniteFramework/orm#920
Original author: @dapicester
Originally opened: 2025-02-20
Original state: closed


When using .where_raw() the bindings are not used, resulting in a QueryException.

Here is a simplified example:

query = User.where_raw('name = ?', ('paolo',))
query.to_sql()  
# 'SELECT * FROM "users" WHERE name = ?'
query.all()
# QueryException: syntax error at end of input
# LINE 1: SELECT * FROM "users" WHERE category = ?

It seems that the SQL does not use the given bindings.

Similar to #267, but the problem is still present.
I am using `masonite-orm==2.24.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions