Skip to content

(breaking) Optional parameters take &Option<T> instead of Option<&T> #288

@LouisGariepy

Description

@LouisGariepy

Migrated from halcyonnouveau/clorinde#106, originally reported by @TimDiekmann on 2025-05-30.

When parameters in queries are nullable, the generated query takes a reference to an option rather than an optional reference.
It's unidiomatic, to pass &Option<T> because with Option::as_ref() you can convert &Option<T> to Option<&T> but you may cannot create the reversed easily.

Is it possible to change that behavior?

Metadata

Metadata

Assignees

No one assigned

    Labels

    breakingIntroduces breaking changes.codegenAn issue regarding code generation, or the generated code itself.

    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