sql-gen icon indicating copy to clipboard operation
sql-gen copied to clipboard

fix: postgres array_depth i16 to i32.

Open Blankeos opened this issue 7 months ago • 1 comments

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): image

Blankeos avatar Jul 18 '25 13:07 Blankeos

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:

  • i32 is INT4; and
  • i16 is INT2 (because it fails when i32 wrongfully casts INT2.

Probably need to find a way to have explicitly store them on their own variables.

Blankeos avatar Jul 25 '25 14:07 Blankeos