Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgres date fields become strings #44

Open
richp10 opened this issue Oct 25, 2021 · 1 comment
Open

Postgres date fields become strings #44

richp10 opened this issue Oct 25, 2021 · 1 comment

Comments

@richp10
Copy link

richp10 commented Oct 25, 2021

If I have a date field - the gmq model created translates this into a string field containing (for example)

2007-09-10T00:00:00Z

I see no obvious reason why this could not be created as a golang datetime?

Any chance of this being the standard behaviour - or maybe optional as a switch?

@mijia
Copy link
Owner

mijia commented Oct 26, 2021

Hi @richp10, I have little experiences on Postgres. But in MySQL case, we have to pass a query param ?parseTime=true in the db connection URI string. Maybe you can try it on the Postgres connection.
By the way, this project is so far beyond maintenance and really out dated. I would recommend to look into other ORM framwork, or sqlx, or Facebook/ent.

Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants