-
Notifications
You must be signed in to change notification settings - Fork 72
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: Adding support for Spanner with PG Dialect in Database Retriever Service #372
feat: Adding support for Spanner with PG Dialect in Database Retriever Service #372
Conversation
gauravpurohit06
commented
May 2, 2024
- Adding support for Spanner with PG Dialect in Database Retriever Service.
- Queries are used based on auto dialect detection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will review this again.
""" | ||
WHERE (COALESCE({country}) IS NULL OR LOWER(country) LIKE LOWER({country})) | ||
AND (COALESCE({city}) IS NULL OR LOWER(city) LIKE LOWER({city})) | ||
AND (COALESCE({name}) IS NULL OR LOWER(name) LIKE '%' || LOWER({name}) || '%') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add LIMIT 10 (changes here: #369)
""", | ||
params={"airline": airline, "number": number}, | ||
WHERE airline = {} | ||
AND flight_number = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add LIMIT 10
WHERE (COALESCE({departure_airport}) IS NULL OR LOWER(departure_airport) LIKE LOWER({departure_airport})) | ||
AND (COALESCE({arrival_airport}) IS NULL OR LOWER(arrival_airport) LIKE LOWER({arrival_airport})) | ||
AND cast(departure_time as TIMESTAMP) >= CAST({datetime} AS TIMESTAMP) | ||
AND cast(departure_time as TIMESTAMP) < TIMESTAMP_ADD(CAST({datetime} AS TIMESTAMP), INTERVAL 1 DAY) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add LIMIT 10
WHERE (COALESCE({departure_airport}) IS NULL OR LOWER(departure_airport) LIKE LOWER({departure_airport})) | ||
AND (COALESCE({arrival_airport}) IS NULL OR LOWER(arrival_airport) LIKE LOWER({arrival_airport})) | ||
AND CAST(departure_time as timestamptz) >= CAST({datetime} AS timestamptz) | ||
AND cast(departure_time as timestamptz) < spanner.timestamptz_add(CAST({datetime} AS timestamptz), '1 day') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add LIMIT 10
Closing it and changes are tracked on #402 |