will / crystal-pg

a postgres driver for crystal
BSD 3-Clause "New" or "Revised" License
462 stars 77 forks source link

Fix encoding format of time with no-zero offset #183

Closed straight-shoota closed 5 years ago

straight-shoota commented 5 years ago

Fixes #182

bcardiff commented 5 years ago

I believe RFC_3339 will send the nanoseconds instead of microseconds as #175 intended. I am unaware if that is an actual issue.

straight-shoota commented 5 years ago

Yes, it includes 9 sub-second digits. But postgres can understand that, so it's not really an issue.

There is a fraction_digits argument to RFC_3339.format but it's currently not implemented to function as a size limit. We could probably make that work and get the intended microsecond output. This fix is valid none the less.

straight-shoota commented 5 years ago

Btw. Golang driver seems to send 9 digits as well https://github.com/lib/pq/blob/master/encode.go#L487

will commented 5 years ago

released v0.18.1 with just this fix

will commented 5 years ago

Thank you :)