Skip to content

Error: has incompatible types: sql.NullString, interface{} #3656

Open
@omid9h

Description

@omid9h

I have a MySQL query with multiple named parameters. everything is fine but for bellow chunk:

AND (
    sqlc.narg(phone_filter) IS NULL
    OR (
        (
            length (sqlc.narg(phone_filter)) != 11
            OR aes_decrypt (from_base64 (u.phone), sqlc.arg(aes_key)) = sqlc.narg(phone_filter)
        )
        AND (
            length (sqlc.narg(phone_filter)) = 11
            OR aes_decrypt (from_base64 (u.phone), sqlc.arg(aes_key)) LIKE '%' || sqlc.narg(phone_filter) || '%'
        )
    )
)

and for the last line OR aes_decrypt (from_base64 (u.phone), sqlc.arg(aes_key)) LIKE '%' || sqlc.narg(phone_filter) || '%'

I get this error:

# package demorepo error generating code: named param PhoneFilter has incompatible types: sql.NullString, interface{}

any idea how to fix this? thanks

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