File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -254,4 +254,23 @@ private function compileOffsetWithLimit($offset, $limit): string
254
254
255
255
return ' OFFSET ' .(int ) $ offset ;
256
256
}
257
+
258
+ /**
259
+ * Compile a delete statement with joins into SQL.
260
+ *
261
+ * @param \Illuminate\Database\Query\Builder $query
262
+ * @param string $table
263
+ * @param string $where
264
+ * @return string
265
+ */
266
+ protected function compileDeleteWithJoins (Builder $ query , $ table , $ where ): string
267
+ {
268
+ $ joins = $ this ->compileJoins ($ query , $ query ->joins );
269
+
270
+ // SingleStore does not support "database.table" in a delete statement when the delete statement contains a join
271
+ // strip the database name from the table, if it exists
272
+ $ deleteTable = last (explode ('. ' , $ table ));
273
+
274
+ return "delete {$ deleteTable } from {$ table } {$ joins } {$ where }" ;
275
+ }
257
276
}
You can’t perform that action at this time.
0 commit comments