kristiandupont / kanel

Generate Typescript types from Postgres
https://kristiandupont.github.io/kanel/
MIT License
829 stars 57 forks source link

text[] issue on V2 #555

Closed kaliq-i closed 1 month ago

kaliq-i commented 1 month ago

Following this issue https://github.com/kristiandupont/kanel/issues/111 - I am unable to upgrade to v3 due to significant breaking changes, is there any recommendation you have for handling the text[] custom map. I've tried

"pg_catalog.text[]": "string[]",

with minimal success. Thanks!

kristiandupont commented 1 month ago

Arrays should work out of the box, unless there is a bug. If you simply remove that type from the custom types object, what do you get?

kaliq-i commented 1 month ago

I am currently on v2.4.5 and unable to update in the near future. Without a customType, the output is text[] rather than string[]. text[] is not recognised by typescript.

image

kristiandupont commented 1 month ago

Ah ok, you want a solution for the old version, I misread that. Maybe try text[]: string[]. I don't quite remember..

kaliq-i commented 1 month ago

gave it a go unfortunately didnt work tried text[]:string[] and below

image

kaliq-i commented 1 month ago

Any ideas, would be super helpful :)

kristiandupont commented 1 month ago

Sorry, I just don't remember how things work. I would recommend upgrading -- everything should still be possible like it was in the old version.

kaliq-i commented 1 month ago

Closed as I've migrated to v3