async-sqlx-session icon indicating copy to clipboard operation
async-sqlx-session copied to clipboard

TIMESTAMP WITH ZONE

Open michaelkimchi opened this issue 4 years ago • 5 comments

Very minor thing but I wonder why we would want to store TIMESTAMP WITH ZONE, it is probably better not to store ZONE and the code is using Utc::now anyway.

https://github.com/jbr/async-sqlx-session/blob/main/src/pg.rs#L157

michaelkimchi avatar Feb 25 '21 08:02 michaelkimchi

Hi, is this repo still active, I would like to do some other dependencies update/making changes, etc..

michaelkimchi avatar May 30 '21 05:05 michaelkimchi

Yes, this repo is still active. I somehow was not watching it, so I did not see notifications. I don't know how that happened, but it's resolved now.

As far as TIMESTAMP WITH ZONE, I don't exactly recall why I chose that. If your sessions table is large enough that the storage size is relevant, I imagine there's additional db tuning we'd want to look at.

jbr avatar Jun 01 '21 21:06 jbr

Thanks for replying @jbr

Yeah not critical, just that I try to avoid TIMESTAMP WITH ZONE wherever possible, it is all headache.

michaelkimchi avatar Jun 02 '21 00:06 michaelkimchi

This makes sense. I'd be amenable to making this change, but we'd need to think through how to do migrations and track table versions, which was something I put off "for later"

jbr avatar Jun 02 '21 02:06 jbr

Ah I was thinking just keep TIMESTAMP instead TIMESTAMP WITH ZONE so the changes should be minimal?

michaelkimchi avatar Jun 02 '21 03:06 michaelkimchi