You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/01/11 03:29:43 UTC

[GitHub] [shardingsphere] TeslaCN opened a new issue #14680: Consider supporting preview SQL with parameter placeholders

TeslaCN opened a new issue #14680:
URL: https://github.com/apache/shardingsphere/issues/14680


   ## Feature Request
   
   ### Is your feature request related to a problem?
   Related to #10814.
   The ShardingSphere-Proxy PostgreSQL doesn't support DESCRIBE prepared statement yet because we cannot fetch the metadata of parameters and result set unless we execute the SQL. If we can preview SQL with parameter placeholders, the logic can be also used for implementing. 
   
   ### Describe the feature you would like.
   
   **Supports previewing SQL with parameter placeholders rather than throwing exceptions.**
   ```
   sbtest_sharding=> preview select * from sbtest1;
    data_source_name |                                                                                                                         
                                              sql                                                                                              
                                                                         
   ------------------+-------------------------------------------------------------------------------------------------------------------------
   --------------------------------------------------------------------------------------------------------------------------------------------
   ----------------------------------------------------------------------
    ds_0             | select * from sbtest1_0 UNION ALL select * from sbtest1_1 UNION ALL select * from sbtest1_2 UNION ALL select * from sbte
   st1_3 UNION ALL select * from sbtest1_4 UNION ALL select * from sbtest1_5 UNION ALL select * from sbtest1_6 UNION ALL select * from sbtest1_
   7 UNION ALL select * from sbtest1_8 UNION ALL select * from sbtest1_9
    ds_1             | select * from sbtest1_0 UNION ALL select * from sbtest1_1 UNION ALL select * from sbtest1_2 UNION ALL select * from sbte
   st1_3 UNION ALL select * from sbtest1_4 UNION ALL select * from sbtest1_5 UNION ALL select * from sbtest1_6 UNION ALL select * from sbtest1_
   7 UNION ALL select * from sbtest1_8 UNION ALL select * from sbtest1_9
   (2 rows)
   
   sbtest_sharding=> preview select * from sbtest1 where id = ?;
   ERROR:  Parameter marker expression must have corresponding parameter value.
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] TeslaCN closed issue #14680: Consider supporting preview SQL with parameter placeholders

Posted by GitBox <gi...@apache.org>.
TeslaCN closed issue #14680:
URL: https://github.com/apache/shardingsphere/issues/14680


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org