diff options
| author | lsces <lester@lsces.co.uk> | 2026-02-28 08:33:51 +0000 |
|---|---|---|
| committer | lsces <lester@lsces.co.uk> | 2026-02-28 08:33:51 +0000 |
| commit | f2c1c01679d92a329e9405ba4f5d43896180b4f6 (patch) | |
| tree | 2fb24401bc4a951f1863e36a74071ba2bc56631d | |
| parent | 1918817c7eec93cbf7203fc8f4bd0e0b62ed2468 (diff) | |
| download | illuminate-firebird-f2c1c01679d92a329e9405ba4f5d43896180b4f6.tar.gz illuminate-firebird-f2c1c01679d92a329e9405ba4f5d43896180b4f6.tar.bz2 illuminate-firebird-f2c1c01679d92a329e9405ba4f5d43896180b4f6.zip | |
Split up a multi element insert back to single inserts since firebird does not support the multi insert operation
| -rwxr-xr-x | src/Query/FirebirdBuilder.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Query/FirebirdBuilder.php b/src/Query/FirebirdBuilder.php index 9d74965..73c8047 100755 --- a/src/Query/FirebirdBuilder.php +++ b/src/Query/FirebirdBuilder.php @@ -39,6 +39,25 @@ class FirebirdBuilder extends QueryBuilder return $this; } + /** + * Insert new records into the database. + * + * @return bool + */ + public function insert(array $values) + { + // Handle multi-row inserts by looping + if (count($values) > 1 && is_array(reset($values))) { + $results = []; + foreach ($values as $row) { + $results[] = parent::insert($row); + } + return end($results); + } + + // Single row or already formatted correctly + return parent::insert($values); + } public function where($column, $operator = NULL, $value = NULL, $boolean = 'and') { // Not sure what this was intended to fix, but target hidden for now |
