slick-pg icon indicating copy to clipboard operation
slick-pg copied to clipboard

Would it be possible for slick-pg to support updateReturning?

Open hanfeisun opened this issue 9 years ago • 3 comments

In Slick, insertReturning is supported, which is returning the case class for the inserted Row after inserting.

but the updateReturning is not supported. This looks reasonable because not every SQL database supports the RETURNING clause.

In Postgres, RETURNING clause is supported, which means the updating and selecting can be done in one query instead of two queries.

http://www.postgresql.org/docs/9.1/static/sql-update.html

Someone implemented the updateReturning method, but it only works for slick 2.x..

http://stackoverflow.com/questions/23561953/slick-2-update-columns-in-a-table-and-return-whole-table-object

It would be great if a method called updateReturning could be added to slick-pg..

hanfeisun avatar May 13 '15 11:05 hanfeisun

Hi @hanfeisun, it requires foundation support from slick. There's already an associated issue slick/slick#963, we can watch it.

tminglei avatar May 13 '15 13:05 tminglei

What's the slick foundational support required for this?

The linked slick ticket seems to indicate that it needs driver-specific implementation, and doesn't seem to be making any progress on its own.

virusdave avatar Jun 13 '17 19:06 virusdave

@virusdave I want slick to support the returning syntax in the update invoker.

tminglei avatar Jun 20 '17 02:06 tminglei