-
Note: This question might be more or less answered in this question on recursive queries and tied to this issue on a SeaQuery migration guide. However, I did not manage to solve my problem with those answers, as I did not understand how to get a SelectStatement from a WithQuery. I am trying to run a recursive CTE with SeaORM, and use SeaQuery to produce the SQL query. Currently, the following code snippet shows what I do:
The complete diagnostic message is:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
I have now solved this by making a Statement from string, which feels like a workaround, but might be the way to query a WithQuery?
For my solution I needed a Builder (not the same as the DatabaseBackend named builder in the Cookbook), which I had to set manually. Is there any way to manipulate the result of db.get_database_backend().get_query_builder() for use in .to_string?
|
Beta Was this translation helpful? Give feedback.
-
Hey @torleivf, please read https://www.sea-ql.org/sea-orm-cookbook/003-run-sea-query-statement-on-sea-orm.html |
Beta Was this translation helpful? Give feedback.
Hey @torleivf, I just added a PR. It should solve it.