[sqlalchemy] Announcement: API Logic Server Docker Support

2021-09-26 Thread Val Huber
You may be interested in ApiLogicServer , open source on Git (79k downloads to date). With 1 command, it creates a customizable project providing a JSON:API, and a Basic Web App. These are based on SQLAlchemy, so it uses sqlacodegen to create

Re: [sqlalchemy] recursive cte use current row as anchor

2021-09-26 Thread Mike Bayer
changing it more the way you had lineage_nodes = recursive_cte.union_all( select([s.c.id, s.c._enabling_factor, s.c.selfreferencing_staff_id]) .join( recursive_cte, recursive_cte.c.selfreferencing_staff_id == s.c.id ) .filter(recursive_cte.c._enabling_factor == None) ) pro

Re: [sqlalchemy] recursive cte use current row as anchor

2021-09-26 Thread Mike Bayer
i applied an alias to the CTE before unioning it, please take that out and try again. CTE inside the subquery can't happen, but shoudnt be necessary. On Sun, Sep 26, 2021, at 3:53 PM, niuji...@gmail.com wrote: > Hi Mike, > This code doesn't seem to yield desired result, now all the > `effective

Re: [sqlalchemy] recursive cte use current row as anchor

2021-09-26 Thread niuji...@gmail.com
Hi Mike, This code doesn't seem to yield desired result, now all the `effective_enabling_factor` is `None`, except for those rows that carries a `_enabling_factor` on itself. In other words, it doesn't seem to recusively search the next immediately parent's marker at all. And the SQL it generat

Re: [sqlalchemy] recursive cte use current row as anchor

2021-09-26 Thread Mike Bayer
OK there's various small issues here but overall SQLAlchemy's new "nesting" feature does not seem to work correctly yet for a RECURSIVE CTE with UNION, meaning it's not very useful for RECURSIVE right now. But here's the thing, I'm not as SQL expert as some people think but I don't think it sho