In QB, is it possible to call delete()
when you also have a join()
statement?
I’d like to execute the following query:
DELETE post
FROM [post]
INNER JOIN [post_category]
ON [post].[id] = [post_category].[postId]
WHERE [post_category].[id] = 5
I have the following QB statement:
qb.from( "post" )
.join( "post_category", function( q ) {
q.on( "post.id", "=", "post_category.postId" );
q.where( "post_category.id", "=", 5 );
} )
.delete()
However, when I output the SQL QB generates, I get this:
DELETE FROM [post]
This feels a little dangerous and I would have expected a different result. Is this behavior intentional? If so, please let me know because I think it should be emphasized in the docs
If it’s a bug, I can create an issue on Github.