You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d64b8d7
Browse filesBrowse the repository at this point in the historyBrowse files
insertRows() computes IDs from the last insert ID, assuming each batch
received a contiguous range. With concurrent inserts, SQL Server and
PostgreSQL can interleave identity values between sessions, so returned
IDs could belong to other connections' rows.
insertRow() and insertRows() now accept an optional idColumn argument
to return the IDs from the insert query itself. SQL Server uses MERGE
... OUTPUT INTO a table variable, which outputs each identity value with
the index of its row, and selects the IDs as a single JSON row (fetching
one row per ID is slow with pdo_sqlsrv when there are many bound
parameters). PostgreSQL uses RETURNING.
Without idColumn, SQL Server now gets the last insert ID from
SCOPE_IDENTITY() rather than @@IDENTITY (as before v7.0), so it's no
longer wrong when a trigger inserts into another identity table, and
no IDs are returned for tables with an INSTEAD OF INSERT trigger.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0 commit comments