Skip to content
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

0.13 breaking changes #135

Closed
michael-land opened this issue Mar 8, 2024 · 4 comments
Closed

0.13 breaking changes #135

michael-land opened this issue Mar 8, 2024 · 4 comments

Comments

@michael-land
Copy link

michael-land commented Mar 8, 2024

Upgrading from version 0.11 to 0.13 results in an error related to the PostgreSQL array type. Generated array type changed from T[] to ArrayType<T>

code

export type ArrayType<T> = T extends ColumnType<infer S, infer I, infer U> ? ColumnType<S[], I[], U[]> : T[];

type X = 'A' | 'B';
type Xs = X[];

type Table = {
  xs: ArrayType<X>;
};

const input: Insertable<Table> = {
  xs: ['A', 'B'],
};

screenshots
CleanShot 2024-03-07 at 23 49 59@2x
CleanShot 2024-03-07 at 23 50 08@2x

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@RobinBlomberg
Copy link
Owner

Thanks for reporting! I'll jump on this immediately.

@RobinBlomberg
Copy link
Owner

RobinBlomberg commented Mar 8, 2024

This feels like a TypeScript limitation, because I'm not sure why these behave differently...

image

Anyway, I'll find a solution. Be back soon.

Edit: Found a 3-day-old TypeScript issue about this: microsoft/TypeScript#57650

@RobinBlomberg
Copy link
Owner

RobinBlomberg commented Mar 8, 2024

Not the most beautiful thing, but it works! Expect a new version within ~15 minutes (I hope, if I don't have to extend the TypeScript generator).

Arrayz

@RobinBlomberg
Copy link
Owner

RobinBlomberg commented Mar 8, 2024

Released in 0.13.1!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants