Closed kavanpancholi closed 2 years ago
@kavanpancholi
It's interesting…
It's not urgent for you?
Can I take some time to think? or if you already have a ready-made patch, send it to me and I will merge it
Hey @pvsaintpe I had this case when I was working on a project, but for now, I've handled this using raw query and it works fine. but if we can think of a way to handle this using PDO then it would be great.
To answer your question,
No, Its is not urgent for me.
And I haven't thought of a way, but I guess we just need to append Returning {primaryKey}
to the insert query and it should work.
@kavanpancholi
ok, we'll see, what can be done in the near future and issue a patch…
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days
When we batch insert into postgres database table, we can get an option by postgres to return all the inserted IDs.
The above statement will retrieve all the Id that has been inserted in bulk. Unfortunately, there is no option to do this natively without using raw query in Laravel since
insertMany()
doesn't return ids or any primary key data.Is there a way to extend this functionality using
laravel-pg-extensions
or by any means?