Skip to content

Automatically infer the types and use better Column names like offset and limit #3281

Open
@eprokhor

Description

@eprokhor

What do you want to change?

https://docs.sqlc.dev/en/stable/howto/named_parameters.html

Not working for postgresql.
original:

...
when 'all' = $1::varchar then true
...

OFFSET $2::int LIMIT $3::int;

tried both ways in docs :

sqlc.arg(exchange) and @exchange

but get errors:
queries/queries.sql:1:1: could not determine data type of parameter $1

WHY bother? Because its annoying/unclear to have to use the following in the code.

    Column1 string
    Column2 int32
    Column3 int32

What database engines need to be changed?

PostgreSQL

What programming language backends need to be changed?

Go

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions