@@ -122,7 +122,7 @@ public function executeGeneric(string $queryName, array $args = [], ?callable $o
122122 }, $ onError );
123123 }
124124
125- public function executeGenericRaw (array $ queries , array $ args = [], ?callable $ onSuccess = null , ?callable $ onError = null ) : void {
125+ public function executeGenericRaw (array $ queries , array $ args = [[] ], ?callable $ onSuccess = null , ?callable $ onError = null ) : void {
126126 $ this ->executeImplRaw ($ queries , $ args , SqlThread::MODE_GENERIC , static function () use ($ onSuccess ){
127127 if ($ onSuccess !== null ){
128128 $ onSuccess ();
@@ -138,10 +138,10 @@ public function executeChange(string $queryName, array $args = [], ?callable $on
138138 }, $ onError );
139139 }
140140
141- public function executeChangeRaw (array $ queries , array $ args = [], ?callable $ onSuccess = null , ?callable $ onError = null ) : void {
142- $ this ->executeImplRaw ($ queries , $ args , SqlThread::MODE_CHANGE , static function (SqlChangeResult $ result ) use ($ onSuccess ){
141+ public function executeChangeRaw (array $ queries , array $ args = [[] ], ?callable $ onSuccess = null , ?callable $ onError = null ) : void {
142+ $ this ->executeImplRaw ($ queries , $ args , SqlThread::MODE_CHANGE , static function (array $ results ) use ($ onSuccess ){
143143 if ($ onSuccess !== null ){
144- $ onSuccess ($ result ->getAffectedRows ());
144+ $ onSuccess (array_map ( fn ( $ result) => $ result ->getAffectedRows (), $ results ));
145145 }
146146 }, $ onError );
147147 }
@@ -154,10 +154,10 @@ public function executeInsert(string $queryName, array $args = [], ?callable $on
154154 }, $ onError );
155155 }
156156
157- public function executeInsertRaw (array $ queries , array $ args = [], ?callable $ onInserted = null , ?callable $ onError = null ) : void {
158- $ this ->executeImplRaw ($ queries , $ args , SqlThread::MODE_INSERT , static function (SqlInsertResult $ result ) use ($ onInserted ){
157+ public function executeInsertRaw (array $ queries , array $ args = [[] ], ?callable $ onInserted = null , ?callable $ onError = null ) : void {
158+ $ this ->executeImplRaw ($ queries , $ args , SqlThread::MODE_INSERT , static function (array $ results ) use ($ onInserted ){
159159 if ($ onInserted !== null ){
160- $ onInserted ($ result ->getInsertId (), $ result -> getAffectedRows ( ));
160+ $ onInserted (array_map ( fn ( $ result) => $ result ->getInsertId (), $ results ));
161161 }
162162 }, $ onError );
163163 }
@@ -170,10 +170,10 @@ public function executeSelect(string $queryName, array $args = [], ?callable $on
170170 }, $ onError );
171171 }
172172
173- public function executeSelectRaw (array $ queries , array $ args = [], ?callable $ onSelect = null , ?callable $ onError = null ) : void {
174- $ this ->executeImplRaw ($ queries , $ args , SqlThread::MODE_SELECT , static function (SqlSelectResult $ result ) use ($ onSelect ){
173+ public function executeSelectRaw (array $ queries , array $ args = [[] ], ?callable $ onSelect = null , ?callable $ onError = null ) : void {
174+ $ this ->executeImplRaw ($ queries , $ args , SqlThread::MODE_SELECT , static function (array $ results ) use ($ onSelect ){
175175 if ($ onSelect !== null ){
176- $ onSelect ($ result ->getRows (), $ result -> getColumnInfo ( ));
176+ $ onSelect (array_map ( fn ( $ result) => $ result ->getRows (), $ results ));
177177 }
178178 }, $ onError );
179179 }
0 commit comments