sql-gen
sql-gen copied to clipboard
fix: postgres array_depth i16 to i32.
fixes https://github.com/jayy-lmao/sql-gen/issues/20
Needs review, this is also more of a demonstration than a PR to confirm my assumptions related to the issue. I haven't tested on INT2. But for INT4 it works...
I also don't know the impact of this PR on mysql yet, it does change some files related to mysql. But have tested on postgres on my setup (in that issue's repro) and it works (it generated files under src/models):
Great tests btw, I just checked this again: https://github.com/jayy-lmao/sql-gen/actions/runs/16371103470/job/46350984033?pr=19#step:6:442
It seems like:
-
i32isINT4; and -
i16isINT2(because it fails wheni32wrongfully casts INT2.
Probably need to find a way to have explicitly store them on their own variables.