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

Provide Comparable expressions for postgres types #2884

Closed
prefanatic opened this issue Feb 8, 2024 · 2 comments
Closed

Provide Comparable expressions for postgres types #2884

prefanatic opened this issue Feb 8, 2024 · 2 comments
Labels
backend-postgres Related to drift_postgres enhancement New feature or request

Comments

@prefanatic
Copy link

prefanatic commented Feb 8, 2024

Is your feature request related to a problem? Please describe.
As a developer, I would like to use Comparable expressions on postgres types.

Describe the solution you'd like
As you would with sqlite Comparable expressions, it would be really nice to extend this to postgres types. For example, being able to query between PgDateTime ranges:

final query = _database.dates.select()
      ..where((tbl) => tbl.date.isBetween(startDate, endDate));
@prefanatic prefanatic added the enhancement New feature or request label Feb 8, 2024
@simolus3 simolus3 added the backend-postgres Related to drift_postgres label Feb 8, 2024
@simolus3
Copy link
Owner

simolus3 commented Feb 8, 2024

I agree, and since the relational operators should work for datetime types in Postgres, it's probably as simple as making PgDateTime implement Comparable so that the extension becomes available.

@simolus3
Copy link
Owner

simolus3 commented Feb 9, 2024

Added in fe57822, the date and timestamp columns can be used to form comparisons with the next release.

@simolus3 simolus3 closed this as completed Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend-postgres Related to drift_postgres enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants