diff --git a/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v4/exec.json b/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v4/exec.json new file mode 100644 index 0000000000..70284f89f1 --- /dev/null +++ b/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v4/exec.json @@ -0,0 +1,5 @@ +{ + "contexts": [ + "base" + ] +} diff --git a/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v4/go/db.go b/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v4/go/db.go new file mode 100644 index 0000000000..58779be81d --- /dev/null +++ b/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v4/go/db.go @@ -0,0 +1,32 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.27.0 + +package querytest + +import ( + "context" + + "github.com/jackc/pgconn" + "github.com/jackc/pgx/v4" +) + +type DBTX interface { + Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error) + Query(context.Context, string, ...interface{}) (pgx.Rows, error) + QueryRow(context.Context, string, ...interface{}) pgx.Row +} + +func New(db DBTX) *Queries { + return &Queries{db: db} +} + +type Queries struct { + db DBTX +} + +func (q *Queries) WithTx(tx pgx.Tx) *Queries { + return &Queries{ + db: tx, + } +} diff --git a/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v4/go/models.go b/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v4/go/models.go new file mode 100644 index 0000000000..7f48124961 --- /dev/null +++ b/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v4/go/models.go @@ -0,0 +1,25 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.27.0 + +package querytest + +import ( + "database/sql" + "time" + + "github.com/google/uuid" +) + +type Memory struct { + ID uuid.UUID + VampireID uuid.UUID + Memory string + Victim string + CreatedAt time.Time + UpdatedAt sql.NullTime +} + +type Vampire struct { + ID uuid.UUID +} diff --git a/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v4/go/querier.go b/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v4/go/querier.go new file mode 100644 index 0000000000..0e41f337f9 --- /dev/null +++ b/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v4/go/querier.go @@ -0,0 +1,16 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.27.0 + +package querytest + +import ( + "context" +) + +type Querier interface { + CreateMemories(ctx context.Context, arg CreateMemoriesParams) ([]Memory, error) + GetMemories(ctx context.Context, arg GetMemoriesParams) ([]GetMemoriesRow, error) +} + +var _ Querier = (*Queries)(nil) diff --git a/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v4/go/query.sql.go b/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v4/go/query.sql.go new file mode 100644 index 0000000000..1347124e37 --- /dev/null +++ b/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v4/go/query.sql.go @@ -0,0 +1,89 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.27.0 +// source: query.sql + +package querytest + +import ( + "context" + + "github.com/google/uuid" +) + +const createMemories = `-- name: CreateMemories :many +INSERT INTO memories (vampire_id, memory, victim) +SELECT + unnest($1::uuid[], $2::text[], $3::text[]) +RETURNING + id, vampire_id, memory, victim, created_at, updated_at +` + +type CreateMemoriesParams struct { + Vampires []uuid.UUID + Memories []string + Victims []string +} + +func (q *Queries) CreateMemories(ctx context.Context, arg CreateMemoriesParams) ([]Memory, error) { + rows, err := q.db.Query(ctx, createMemories, arg.Vampires, arg.Memories, arg.Victims) + if err != nil { + return nil, err + } + defer rows.Close() + var items []Memory + for rows.Next() { + var i Memory + if err := rows.Scan( + &i.ID, + &i.VampireID, + &i.Memory, + &i.Victim, + &i.CreatedAt, + &i.UpdatedAt, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const getMemories = `-- name: GetMemories :many +SELECT vampires.id::uuid, vampires.memory::text, vampires.victim::text FROM unnest($1::uuid[], $2::text[], $3::text[]) AS vampires (id, memory, victim) +` + +type GetMemoriesParams struct { + Vampires []uuid.UUID + Memories []string + Victims []string +} + +type GetMemoriesRow struct { + VampiresID uuid.UUID + VampiresMemory string + VampiresVictim string +} + +func (q *Queries) GetMemories(ctx context.Context, arg GetMemoriesParams) ([]GetMemoriesRow, error) { + rows, err := q.db.Query(ctx, getMemories, arg.Vampires, arg.Memories, arg.Victims) + if err != nil { + return nil, err + } + defer rows.Close() + var items []GetMemoriesRow + for rows.Next() { + var i GetMemoriesRow + if err := rows.Scan(&i.VampiresID, &i.VampiresMemory, &i.VampiresVictim); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} diff --git a/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v4/query.sql b/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v4/query.sql new file mode 100644 index 0000000000..9f68d6a231 --- /dev/null +++ b/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v4/query.sql @@ -0,0 +1,9 @@ +-- name: CreateMemories :many +INSERT INTO memories (vampire_id, memory, victim) +SELECT + unnest(@vampires::uuid[], @memories::text[], @victims::text[]) +RETURNING + *; + +-- name: GetMemories :many +SELECT vampires.id::uuid, vampires.memory::text, vampires.victim::text FROM unnest(@vampires::uuid[], @memories::text[], @victims::text[]) AS vampires (id, memory, victim); diff --git a/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v4/schema.sql b/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v4/schema.sql new file mode 100644 index 0000000000..f9e6714af4 --- /dev/null +++ b/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v4/schema.sql @@ -0,0 +1,12 @@ +CREATE TABLE vampires ( + id uuid PRIMARY KEY DEFAULT gen_random_uuid () +); + +CREATE TABLE memories ( + id uuid PRIMARY KEY DEFAULT gen_random_uuid (), + vampire_id uuid REFERENCES vampires (id) NOT NULL, + memory text NOT NULL, + victim text NOT NULL, + created_at timestamp NOT NULL DEFAULT NOW(), + updated_at timestamp +); diff --git a/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v4/sqlc.json b/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v4/sqlc.json new file mode 100644 index 0000000000..e0530db353 --- /dev/null +++ b/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v4/sqlc.json @@ -0,0 +1,14 @@ +{ + "version": "1", + "packages": [ + { + "path": "go", + "engine": "postgresql", + "sql_package": "pgx/v4", + "name": "querytest", + "schema": "schema.sql", + "queries": "query.sql", + "emit_interface": true + } + ] +} diff --git a/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v5/exec.json b/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v5/exec.json new file mode 100644 index 0000000000..70284f89f1 --- /dev/null +++ b/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v5/exec.json @@ -0,0 +1,5 @@ +{ + "contexts": [ + "base" + ] +} diff --git a/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v5/go/db.go b/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v5/go/db.go new file mode 100644 index 0000000000..69ef001548 --- /dev/null +++ b/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v5/go/db.go @@ -0,0 +1,32 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.27.0 + +package querytest + +import ( + "context" + + "github.com/jackc/pgx/v5" + "github.com/jackc/pgx/v5/pgconn" +) + +type DBTX interface { + Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error) + Query(context.Context, string, ...interface{}) (pgx.Rows, error) + QueryRow(context.Context, string, ...interface{}) pgx.Row +} + +func New(db DBTX) *Queries { + return &Queries{db: db} +} + +type Queries struct { + db DBTX +} + +func (q *Queries) WithTx(tx pgx.Tx) *Queries { + return &Queries{ + db: tx, + } +} diff --git a/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v5/go/models.go b/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v5/go/models.go new file mode 100644 index 0000000000..91fc8705a0 --- /dev/null +++ b/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v5/go/models.go @@ -0,0 +1,22 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.27.0 + +package querytest + +import ( + "github.com/jackc/pgx/v5/pgtype" +) + +type Memory struct { + ID pgtype.UUID + VampireID pgtype.UUID + Memory string + Victim string + CreatedAt pgtype.Timestamp + UpdatedAt pgtype.Timestamp +} + +type Vampire struct { + ID pgtype.UUID +} diff --git a/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v5/go/querier.go b/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v5/go/querier.go new file mode 100644 index 0000000000..0e41f337f9 --- /dev/null +++ b/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v5/go/querier.go @@ -0,0 +1,16 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.27.0 + +package querytest + +import ( + "context" +) + +type Querier interface { + CreateMemories(ctx context.Context, arg CreateMemoriesParams) ([]Memory, error) + GetMemories(ctx context.Context, arg GetMemoriesParams) ([]GetMemoriesRow, error) +} + +var _ Querier = (*Queries)(nil) diff --git a/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v5/go/query.sql.go b/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v5/go/query.sql.go new file mode 100644 index 0000000000..cbe6805fcf --- /dev/null +++ b/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v5/go/query.sql.go @@ -0,0 +1,89 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.27.0 +// source: query.sql + +package querytest + +import ( + "context" + + "github.com/jackc/pgx/v5/pgtype" +) + +const createMemories = `-- name: CreateMemories :many +INSERT INTO memories (vampire_id, memory, victim) +SELECT + unnest($1::uuid[], $2::text[], $3::text[]) +RETURNING + id, vampire_id, memory, victim, created_at, updated_at +` + +type CreateMemoriesParams struct { + Vampires []pgtype.UUID + Memories []string + Victims []string +} + +func (q *Queries) CreateMemories(ctx context.Context, arg CreateMemoriesParams) ([]Memory, error) { + rows, err := q.db.Query(ctx, createMemories, arg.Vampires, arg.Memories, arg.Victims) + if err != nil { + return nil, err + } + defer rows.Close() + var items []Memory + for rows.Next() { + var i Memory + if err := rows.Scan( + &i.ID, + &i.VampireID, + &i.Memory, + &i.Victim, + &i.CreatedAt, + &i.UpdatedAt, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const getMemories = `-- name: GetMemories :many +SELECT vampires.id::uuid, vampires.memory::text, vampires.victim::text FROM unnest($1::uuid[], $2::text[], $3::text[]) AS vampires(id, memory, victim) +` + +type GetMemoriesParams struct { + Vampires []pgtype.UUID + Memories []string + Victims []string +} + +type GetMemoriesRow struct { + VampiresID pgtype.UUID + VampiresMemory string + VampiresVictim string +} + +func (q *Queries) GetMemories(ctx context.Context, arg GetMemoriesParams) ([]GetMemoriesRow, error) { + rows, err := q.db.Query(ctx, getMemories, arg.Vampires, arg.Memories, arg.Victims) + if err != nil { + return nil, err + } + defer rows.Close() + var items []GetMemoriesRow + for rows.Next() { + var i GetMemoriesRow + if err := rows.Scan(&i.VampiresID, &i.VampiresMemory, &i.VampiresVictim); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} diff --git a/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v5/query.sql b/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v5/query.sql new file mode 100644 index 0000000000..79999815a5 --- /dev/null +++ b/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v5/query.sql @@ -0,0 +1,9 @@ +-- name: CreateMemories :many +INSERT INTO memories (vampire_id, memory, victim) +SELECT + unnest(@vampires::uuid[], @memories::text[], @victims::text[]) +RETURNING + *; + +-- name: GetMemories :many +SELECT vampires.id::uuid, vampires.memory::text, vampires.victim::text FROM unnest(@vampires::uuid[], @memories::text[], @victims::text[]) AS vampires(id, memory, victim); diff --git a/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v5/schema.sql b/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v5/schema.sql new file mode 100644 index 0000000000..f9e6714af4 --- /dev/null +++ b/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v5/schema.sql @@ -0,0 +1,12 @@ +CREATE TABLE vampires ( + id uuid PRIMARY KEY DEFAULT gen_random_uuid () +); + +CREATE TABLE memories ( + id uuid PRIMARY KEY DEFAULT gen_random_uuid (), + vampire_id uuid REFERENCES vampires (id) NOT NULL, + memory text NOT NULL, + victim text NOT NULL, + created_at timestamp NOT NULL DEFAULT NOW(), + updated_at timestamp +); diff --git a/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v5/sqlc.json b/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v5/sqlc.json new file mode 100644 index 0000000000..007fb8530f --- /dev/null +++ b/internal/endtoend/testdata/unnest_multiple/postgresql/pgx/v5/sqlc.json @@ -0,0 +1,14 @@ +{ + "version": "1", + "packages": [ + { + "path": "go", + "engine": "postgresql", + "sql_package": "pgx/v5", + "name": "querytest", + "schema": "schema.sql", + "queries": "query.sql", + "emit_interface": true + } + ] +} diff --git a/internal/endtoend/testdata/unnest_multiple/postgresql/stdlib/exec.json b/internal/endtoend/testdata/unnest_multiple/postgresql/stdlib/exec.json new file mode 100644 index 0000000000..70284f89f1 --- /dev/null +++ b/internal/endtoend/testdata/unnest_multiple/postgresql/stdlib/exec.json @@ -0,0 +1,5 @@ +{ + "contexts": [ + "base" + ] +} diff --git a/internal/endtoend/testdata/unnest_multiple/postgresql/stdlib/go/db.go b/internal/endtoend/testdata/unnest_multiple/postgresql/stdlib/go/db.go new file mode 100644 index 0000000000..0ea90b328a --- /dev/null +++ b/internal/endtoend/testdata/unnest_multiple/postgresql/stdlib/go/db.go @@ -0,0 +1,31 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.27.0 + +package querytest + +import ( + "context" + "database/sql" +) + +type DBTX interface { + ExecContext(context.Context, string, ...interface{}) (sql.Result, error) + PrepareContext(context.Context, string) (*sql.Stmt, error) + QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error) + QueryRowContext(context.Context, string, ...interface{}) *sql.Row +} + +func New(db DBTX) *Queries { + return &Queries{db: db} +} + +type Queries struct { + db DBTX +} + +func (q *Queries) WithTx(tx *sql.Tx) *Queries { + return &Queries{ + db: tx, + } +} diff --git a/internal/endtoend/testdata/unnest_multiple/postgresql/stdlib/go/models.go b/internal/endtoend/testdata/unnest_multiple/postgresql/stdlib/go/models.go new file mode 100644 index 0000000000..7f48124961 --- /dev/null +++ b/internal/endtoend/testdata/unnest_multiple/postgresql/stdlib/go/models.go @@ -0,0 +1,25 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.27.0 + +package querytest + +import ( + "database/sql" + "time" + + "github.com/google/uuid" +) + +type Memory struct { + ID uuid.UUID + VampireID uuid.UUID + Memory string + Victim string + CreatedAt time.Time + UpdatedAt sql.NullTime +} + +type Vampire struct { + ID uuid.UUID +} diff --git a/internal/endtoend/testdata/unnest_multiple/postgresql/stdlib/go/querier.go b/internal/endtoend/testdata/unnest_multiple/postgresql/stdlib/go/querier.go new file mode 100644 index 0000000000..0e41f337f9 --- /dev/null +++ b/internal/endtoend/testdata/unnest_multiple/postgresql/stdlib/go/querier.go @@ -0,0 +1,16 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.27.0 + +package querytest + +import ( + "context" +) + +type Querier interface { + CreateMemories(ctx context.Context, arg CreateMemoriesParams) ([]Memory, error) + GetMemories(ctx context.Context, arg GetMemoriesParams) ([]GetMemoriesRow, error) +} + +var _ Querier = (*Queries)(nil) diff --git a/internal/endtoend/testdata/unnest_multiple/postgresql/stdlib/go/query.sql.go b/internal/endtoend/testdata/unnest_multiple/postgresql/stdlib/go/query.sql.go new file mode 100644 index 0000000000..8463eafce1 --- /dev/null +++ b/internal/endtoend/testdata/unnest_multiple/postgresql/stdlib/go/query.sql.go @@ -0,0 +1,96 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.27.0 +// source: query.sql + +package querytest + +import ( + "context" + + "github.com/google/uuid" + "github.com/lib/pq" +) + +const createMemories = `-- name: CreateMemories :many +INSERT INTO memories (vampire_id, memory, victim) +SELECT + unnest($1::uuid[], $2::text[], $3::text[]) +RETURNING + id, vampire_id, memory, victim, created_at, updated_at +` + +type CreateMemoriesParams struct { + Vampires []uuid.UUID + Memories []string + Victims []string +} + +func (q *Queries) CreateMemories(ctx context.Context, arg CreateMemoriesParams) ([]Memory, error) { + rows, err := q.db.QueryContext(ctx, createMemories, pq.Array(arg.Vampires), pq.Array(arg.Memories), pq.Array(arg.Victims)) + if err != nil { + return nil, err + } + defer rows.Close() + var items []Memory + for rows.Next() { + var i Memory + if err := rows.Scan( + &i.ID, + &i.VampireID, + &i.Memory, + &i.Victim, + &i.CreatedAt, + &i.UpdatedAt, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Close(); err != nil { + return nil, err + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const getMemories = `-- name: GetMemories :many +SELECT vampires.id::uuid, vampires.memory::text, vampires.victim::text FROM unnest($1::uuid[], $2::text[], $3::text[]) AS vampires (id, memory, victim) +` + +type GetMemoriesParams struct { + Vampires []uuid.UUID + Memories []string + Victims []string +} + +type GetMemoriesRow struct { + VampiresID uuid.UUID + VampiresMemory string + VampiresVictim string +} + +func (q *Queries) GetMemories(ctx context.Context, arg GetMemoriesParams) ([]GetMemoriesRow, error) { + rows, err := q.db.QueryContext(ctx, getMemories, pq.Array(arg.Vampires), pq.Array(arg.Memories), pq.Array(arg.Victims)) + if err != nil { + return nil, err + } + defer rows.Close() + var items []GetMemoriesRow + for rows.Next() { + var i GetMemoriesRow + if err := rows.Scan(&i.VampiresID, &i.VampiresMemory, &i.VampiresVictim); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Close(); err != nil { + return nil, err + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} diff --git a/internal/endtoend/testdata/unnest_multiple/postgresql/stdlib/query.sql b/internal/endtoend/testdata/unnest_multiple/postgresql/stdlib/query.sql new file mode 100644 index 0000000000..9f68d6a231 --- /dev/null +++ b/internal/endtoend/testdata/unnest_multiple/postgresql/stdlib/query.sql @@ -0,0 +1,9 @@ +-- name: CreateMemories :many +INSERT INTO memories (vampire_id, memory, victim) +SELECT + unnest(@vampires::uuid[], @memories::text[], @victims::text[]) +RETURNING + *; + +-- name: GetMemories :many +SELECT vampires.id::uuid, vampires.memory::text, vampires.victim::text FROM unnest(@vampires::uuid[], @memories::text[], @victims::text[]) AS vampires (id, memory, victim); diff --git a/internal/endtoend/testdata/unnest_multiple/postgresql/stdlib/schema.sql b/internal/endtoend/testdata/unnest_multiple/postgresql/stdlib/schema.sql new file mode 100644 index 0000000000..f9e6714af4 --- /dev/null +++ b/internal/endtoend/testdata/unnest_multiple/postgresql/stdlib/schema.sql @@ -0,0 +1,12 @@ +CREATE TABLE vampires ( + id uuid PRIMARY KEY DEFAULT gen_random_uuid () +); + +CREATE TABLE memories ( + id uuid PRIMARY KEY DEFAULT gen_random_uuid (), + vampire_id uuid REFERENCES vampires (id) NOT NULL, + memory text NOT NULL, + victim text NOT NULL, + created_at timestamp NOT NULL DEFAULT NOW(), + updated_at timestamp +); diff --git a/internal/endtoend/testdata/unnest_multiple/postgresql/stdlib/sqlc.json b/internal/endtoend/testdata/unnest_multiple/postgresql/stdlib/sqlc.json new file mode 100644 index 0000000000..36f98f9072 --- /dev/null +++ b/internal/endtoend/testdata/unnest_multiple/postgresql/stdlib/sqlc.json @@ -0,0 +1,13 @@ +{ + "version": "1", + "packages": [ + { + "path": "go", + "engine": "postgresql", + "name": "querytest", + "schema": "schema.sql", + "queries": "query.sql", + "emit_interface": true + } + ] +} diff --git a/internal/sql/catalog/public.go b/internal/sql/catalog/public.go index 19fd50722f..899008a387 100644 --- a/internal/sql/catalog/public.go +++ b/internal/sql/catalog/public.go @@ -72,7 +72,7 @@ func (c *Catalog) ResolveFuncCall(call *ast.FuncCall) (*Function, error) { if arg.HasDefault { defaults += 1 } - if arg.Mode == ast.FuncParamVariadic { + if arg.Mode == ast.FuncParamVariadic || arg.Type.Name == "anymultirange" { variadic = true defaults += 1 }