Skip to content

varchar[] is generated as string instead of []string #2638

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
InbarPerry opened this issue Aug 20, 2023 · 3 comments
Closed

varchar[] is generated as string instead of []string #2638

InbarPerry opened this issue Aug 20, 2023 · 3 comments
Labels
bug Something isn't working triage New issues that hasn't been reviewed

Comments

@InbarPerry
Copy link

InbarPerry commented Aug 20, 2023

Version

1.20.0

What happened?

SQLC is generating base type (not array) for columns that was added in a separate migration.
This is a new bug introduced in 1.20 (worked in 1.19)

Relevant log output

// Output in sqlc 1.19:

type Author struct {
	ID    uuid.NullUUID
	Books []string
}

// Output in sqlc 1.20:

type Author struct {
	ID    uuid.NullUUID
	Books string
}

Database schema

CREATE TABLE authors (
  id UUID
);

ALTER TABLE authors ADD COLUMN IF NOT EXISTS books VARCHAR(255)[] DEFAULT NULL;

SQL queries

No response

Configuration

No response

Playground URL

(1.20) https://play.sqlc.dev/p/53e5f0dcb79fb2071328bfdb8507b08b340bfc6024735b53b27a89260d147647
(1.19) https://play.sqlc.dev/p/5f0472ede5543014774f5115321cb73d09e336c8230b90d464892c185a75972e

What operating system are you using?

macOS

What database engines are you using?

PostgreSQL

What type of code are you generating?

Go

@InbarPerry InbarPerry added bug Something isn't working triage New issues that hasn't been reviewed labels Aug 20, 2023
@orisano
Copy link
Contributor

orisano commented Aug 20, 2023

@InbarPerry This problem has already been solved by #2572 (not yet released)

@0xull
Copy link

0xull commented Aug 20, 2023

Just ran into the same issue. When is the release scheduled for? I'm sort of stagnant as a result of it.

@InbarPerry
Copy link
Author

Closed issue because it's duplicate of #2571

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage New issues that hasn't been reviewed
Projects
None yet
Development

No branches or pull requests

3 participants