vapor / fluent-postgres-driver

🐘 PostgreSQL driver for Fluent.
MIT License
146 stars 53 forks source link

Migrations are now creating int8 fields as char in the DB and then the value gets messed up when querying #165

Open raphaelcruzeiro opened 4 years ago

raphaelcruzeiro commented 4 years ago

I was testing some code on my local machine using a project that is actually deployed to production and works fine there when I noticed that querying one of my models which had int8 fields (all of which have values that can vary between 0 and 7) the resulting Swift object had wildly incorrect values like 49, 50, 51, etc. As querying using my sql client returned me the correct values, it took me a while to notice that the same migration that had created the fields as int4 in production a few months ago was now creating these fields as char. So my local database had the "correct" char as in '1' but whatever the postgres driver is doing when quering it, it was effectivelly messing up the conversion back to int in Swift ('1' became 49, etc).

Version

2.1.0

Steps to reproduce:

abear247 commented 1 year ago

We are also experiencing this issue. Any hope for a fix?