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

feat: Add --date-parser flag to control Postgres DATE type #210

Merged

Conversation

brianmcd
Copy link
Contributor

Many people prefer to parse DATE columns as strings due to timezone issues with JS Dates. This adds a new flag, --date-parser, that allows the user to choose between using Date or string as the type for DATE columns.

I mostly just pattern matched against how --numeric-parser was implemented.

Closes #194

Many people prefer to parse DATE columns as `strings` due to timezone
issues with JS `Date`s. This adds a new flag, --date-parser, that allows
the user to choose between using `Date` or `string` as the type for DATE
columns.
@@ -0,0 +1,6 @@
export const enum DateParser {
STRING = 'string',
TIMESTAMP = 'timestamp'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't sure if it made sense to call this TIMESTAMP or DATE, but I went with TIMESTAMP to match the existing generated types.

@brianmcd brianmcd mentioned this pull request Oct 16, 2024
@RobinBlomberg RobinBlomberg merged commit d8982c0 into RobinBlomberg:master Oct 17, 2024
@RobinBlomberg
Copy link
Owner

Great work! 🚀 This should be released shortly.

@brianmcd brianmcd deleted the parse-date-as-string-postgres branch October 17, 2024 14:49
@brianmcd
Copy link
Contributor Author

Great work! 🚀 This should be released shortly.

Thanks for merging!

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

Successfully merging this pull request may close these issues.

Postgres DATE type
2 participants