I was thinking of an idea to tell the select to include the WITH statement 
if it is only embeded in an INSERT/UPDATE/DELETE for the sqlalchemy-exasol 
dialect. Since the variable `toplevel` affects this, a method controlling 
this variable was my first guess. I'm open for different ideas and would 
contribute something if this helps. With the current implementation I see 
no way to fix this sqlalchemy-exasol bug without copy the complete 
visit_insert/select/... methods.

>
> I'm not following how that would work.  It looks like this merely 
> impacts the assembly of the insert() construct as far as 
> insert_stmt.select and self.ctes, if we look around line 3028 of 
> compiler.py in visit_insert().    It would be cheaper to provide some 
> hook here for alternate assembly of the insert().    Turning self.stack 
> into a method adds overhead to visit_select() which is considered to be 
> more performance critical than visit_insert(). 
>
> However, if this database has similar non-standard arrangements for 
> other kinds of constructs like UPDATE and DELETE, those should be 
> considered as well. 
>
>

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to