iffyio commented on code in PR #2276:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/2276#discussion_r2931357519


##########
tests/sqlparser_oracle.rs:
##########
@@ -542,3 +542,37 @@ fn test_insert_without_alias() {
         if matches!(&*source, Query { body, .. } if matches!(&**body, 
SetExpr::Values(_)))
     ));
 }
+
+#[test]
+fn test_insert_with_query_table() {
+    let oracle_dialect = oracle();

Review Comment:
   can we add the test to common.rs instead using the `all_dialect_where` 
helper? maybe here for oracle specifically we can add a test asserting that it 
implements the dialect function



##########
src/dialect/oracle.rs:
##########
@@ -114,4 +114,8 @@ impl Dialect for OracleDialect {
     fn supports_insert_table_alias(&self) -> bool {
         true
     }
+
+    fn supports_insert_table_query(&self) -> bool {

Review Comment:
   Can we add a link to the oracle docs here?



##########
src/parser/mod.rs:
##########
@@ -17518,11 +17521,15 @@ impl<'a> Parser<'a> {
     }
 
     /// Returns true if the immediate tokens look like the
-    /// beginning of a subquery. `(SELECT ...`
-    fn peek_subquery_start(&mut self) -> bool {
+    /// beginning of a subquery, e.g. `(SELECT ...`.
+    ///
+    /// If `full_query == true` attempt to detect a full query with its
+    /// optional, leading `WITH` clause, e.g. `(WITH ...)`
+    fn peek_subquery_start(&mut self, full_query: bool) -> bool {

Review Comment:
   can we maybe add a separate function `peek_cte_or_subquery` (maybe better 
naming) that handles the `WITH` case? i.e.
   ```
   return self.peek_token(LPAREN, WITH) || self.peek_subquery_start()
   ```
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to