Skip to content

UUID package not imported from unnest(@param::uuid[]) #1253

@jdbann

Description

@jdbann

Version

1.10.0

What happened?

I'm providing a list of UUIDs as a param to create a set of blank records. Everything else is working correctly, but the "github.com/google/uuid" package is not being imported in the resulting file.

Relevant log output

No response

Database schema

CREATE TABLE memories (
    id uuid PRIMARY KEY DEFAULT gen_random_uuid (),
    vampire_id uuid REFERENCES vampires (id) NOT NULL,
    created_at timestamp NOT NULL DEFAULT NOW(),
    updated_at timestamp
);

SQL queries

-- name: CreateMemories :many
INSERT INTO memories (vampire_id)
SELECT
    unnest(@vampire_id::uuid[]) AS vampire_id
RETURNING
    *;

Configuration

{
  "version": "1",
  "packages": [
    {
      "path": "db",
      "engine": "postgresql",
	  "sql_package": "pgx/v4",
      "schema": "query.sql",
      "queries": "query.sql"
    }
  ]
}

Playground URL

https://play.sqlc.dev/p/5a3d78f7b6aa94028c15c60170c7419cbffc435e664fbaf50f2871b8df1e271f

What operating system are you using?

macOS

What database engines are you using?

PostgreSQL

What type of code are you generating?

Go

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions