pixie
pixie copied to clipboard
Return options for INSERT operations, UPDATE and DELETE
As with the 'queries' sql return run it would be possible for INSERT, UPDATE, and DELETE operations?
$Query = QB::table('my_table')->where('city', '=', 'New York')->update(['name', 'Robert']);
$QueryObj = $query->getQuery();
$QueryObj->getRawSql();
or simply:
$Query->getSQL();
// UPDATE WHERE my_table
city= 'New York' SETname= 'Robert'
It would be possible to also have the return of the number of rows affected?
$ Query->rowsAffected();
// 2
And yet the affected ID?
$Query->idAffecteds();
// 1 // [1,3] <- affected ids.
yes this will be nice option
@robertaodj take a look at the @mrcnpdlk at #151 . At least half of your problem is already fixed.