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

Remove Postgres compile time dependency and implement custom interval class #369

Open
brbrown25 opened this issue Jan 18, 2021 · 2 comments

Comments

@brbrown25
Copy link
Contributor

While working on #295 it was discovered that the PGInterval class does not allow for setting weeks as a constructor argument. Based on discussion here #295 (comment) we should remove the compile time dependency and implement a custom PGInterval that will allow for setting all supported parameters.

@brbrown25
Copy link
Contributor Author

Of note, make_interval will convert weeks into a days representation, so we need to make sure we account for that. for example select make_interval(years => 1, months => 3, weeks => 2, days => 2, hours => 3, mins => 1, secs => 1.0); will return ``` make_interval

1 year 3 mons 16 days 03:01:01``` where 2 weeks = 14 days + 2 days to yield 16 days in the result
Similarly select make_interval(weeks => 1); will yield 7 days.

@brbrown25
Copy link
Contributor Author

Gonna pick back up on this, this week.

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

1 participant