Skip to content

Getting undefined table error when running a query. #942

Closed Answered by dantownsend
AmazingAkai asked this question in Q&A
Discussion options

You must be logged in to vote

It looks like the problem is with the returning clause .returning(Warn.mod_case._.target_id).

Looking at the Piccolo code, the returning clause for delete queries doesn't currently support joins.

For now, you could do it in two queries:

mod_case = await Warn.select(Warn.mod_case._.target_id).where(Warn.mod_case._.id == case_id)
await Warn.delete().where(Warn.mod_case._.id == case_id)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by AmazingAkai
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants