question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adding extra condition to the where clause when parsing SQL

See original GitHub issue

I want to add an extra condition (a value stored in the local thread) to the where clause. Does the shardingsphere SQL parser or rewrite engine have any extension point or mechanism to let me do this? Thanks!

e.g. Origin SQL:

SELECT id, customer_id, product_id, ... FROM order;

Want to add an extra condition

SELECT id, customer_id, product_id, ... FROM order WHERE tenant = 'ABC';

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
wintergaocommented, Jun 10, 2020

I will do some research and PoC, will back later

0reactions
RaigorJiangcommented, Sep 24, 2021

Since this issue has been inactive for more than 1 year, we will close it. If you still have related questions, please submit a new issue, thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Conditional WHERE clauses in SQL - Avoid Smart Logic
Conditional WHERE clauses using “OR ... IS NULL” cause SQL performance problems. Don't try to outsmart the database.
Read more >
Get and Add WHERE clause in SQL Query Python
I have these extra conditions which I want to apply to the query. So, the final query should become: SELECT device_os, count(*) FROM...
Read more >
Parse a valid WHERE clause syntax using PL/SQL - Ask TOM
Parse a valid WHERE clause syntax using PL/SQL I have a predicate column in a table which stores a text which must be...
Read more >
Functions for Use in SELECT and WHERE Clauses - O'Reilly
A select_expression or where_definition in a SQL statement can consist of any expression using the functions described next.
Read more >
Using the WHERE clause to filter data in SQL
The WHERE clause allows us to set the conditions by which rows are fetched from data tables. A condition is some kind of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found