sql-to-builder
sql-to-builder copied to clipboard
SQL to laravel query builder
**SQL** = `select * from t1 join t2 on (t1.column1 = t2.column1) where t1.column2 = t2.column2` **EXPECTED** = `DB::table('t1')->join('t2', 't1.column1', '=','t2.column1' )->whereRaw('t1.column2 = t2.column2')` **RESULT** = `DB::table('t1')->where('t2.column2', '=', '')->get()` >...
Хорошо бы сделать онлайн версию.
Is that a yes?
Input: ``` sql DELETE items FROM items left join items as parent on items.parentID = parent.itemID WHERE parent.itemID is NULL ``` Output: ``` php DB::table('items') ->leftJoin('items', 'items.parentid', '=', 'parent.itemid') ->whereNull('parent.itemid')...