Conversation
This _does not_ add the date window support, yet. This is because there is not a great native rust-postgres way of getting PostgreSQLs DATERANGE type. Looks like there's rust-postgres/rust-postgres-range#18, but it hasn't been merged in a year and the general state of rust-postgres-range seems unmaintained.. perhaps @tkbrigham has a good point in rust-postgres/rust-postgres#601.. it'd be great if all the PostgreSQL features were supported in rust-postgres directly.
149af2c to
1f4910b
Compare
The plan is to use the types publicized by the `grades.rs` modules as grades for the entire schema.
b23b519 to
718a4ca
Compare
Currently, this can be thought of as a subset of an ISO 8601-2 interval string.
For now, the date window is a string displayed like ISO 8601 with intervals. It could make sense to make this a scalar of some kind to enforce the implementation. Some notes on implementation.. - the PostgreSQL `DATERANGE` type is queries as `::TEXT` since rust-postgres doesn't appear (or that I could find) to allow the user to specify the [format per returned column](https://www.postgresql.org/docs/9.3/protocol-overview.html#PROTOCOL-FORMAT-CODES).. and so the `FromSql` implementation must accept a `TEXT` type as well. - the `DATERANGE` is [always of the format `[)`](https://www.postgresql.org/docs/current/rangetypes.html#RANGETYPES-DISCRETE) (or `()` when the bottom is unbounded), so this makes parsing quite simple. The PostgeSQL parser should be considered private to the `DateInterval` type - the string formatting of date window attribute is done naively.. there are many things that can be done to make the returned values smaller and just as unambiguous
This mutation is used to date (verb) an ascent.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This does not add the date window support, yet. This is because there is not a great native rust-postgres way of getting PostgreSQLs DATERANGE type. Looks like there's rust-postgres/rust-postgres-range#18, but it hasn't been merged in a year and the general state of rust-postgres-range seems unmaintained.. perhaps @tkbrigham has a good point in rust-postgres/rust-postgres#601.. it'd be great if all the PostgreSQL features were supported in rust-postgres directly.