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: Adding support for Spanner with PG Dialect in Database Retriever Service #372

Closed

Conversation

gauravpurohit06
Copy link
Contributor

  • Adding support for Spanner with PG Dialect in Database Retriever Service.
  • Queries are used based on auto dialect detection.

@gauravpurohit06 gauravpurohit06 requested a review from a team as a code owner May 2, 2024 10:32
@gauravpurohit06 gauravpurohit06 changed the title Adding support for Spanner with PG Dialect in Database Retriever Service feat: Adding support for Spanner with PG Dialect in Database Retriever Service May 2, 2024
Copy link
Collaborator

@Yuan325 Yuan325 left a 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}) || '%')
Copy link
Collaborator

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 = {}
Copy link
Collaborator

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)
Copy link
Collaborator

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')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add LIMIT 10

@gauravpurohit06
Copy link
Contributor Author

Closing it and changes are tracked on #402

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.

2 participants