SELECT ... FOR UPDATE SKIP LOCKED

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

SELECT ... FOR UPDATE SKIP LOCKED

Dmitry Belyavsky
Hello,

is there a support for the PostgreSQL SELECT FOR UPDATE SKIP LOCKED clause in the DBIx::Class? And how difficult is to add it if not?

Thank you!


--
SY, Dmitry Belyavsky

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...
Reply | Threaded
Open this post in threaded view
|

Re: SELECT ... FOR UPDATE SKIP LOCKED

Francisco Obispo

just use the scalar version:

for
Value: ( 'update' | 'shared' | \$scalar )

   Set to 'update' for a SELECT ... FOR UPDATE or 'shared' for a SELECT
   ... FOR SHARED. If \$scalar is passed, this is taken directly and
   embedded in the query.

with

{
    for => \q{UPDATE SKIP LOCKED}
}

On 4 May 2016, at 12:59, Dmitry Belyavsky wrote:

Hello,

is there a support for the PostgreSQL SELECT FOR UPDATE SKIP LOCKED clause
in the DBIx::Class? And how difficult is to add it if not?

Thank you!

--
SY, Dmitry Belyavsky


List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...


_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...

signature.asc (858 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SELECT ... FOR UPDATE SKIP LOCKED

Dmitry Belyavsky

Dear Francisco,

Thank you!

When did this possibility appeared?

4 Май 2016 г. 23:09 пользователь "Francisco Obispo" <[hidden email]> написал:

just use the scalar version:

for
Value: ( 'update' | 'shared' | \$scalar )

   Set to 'update' for a SELECT ... FOR UPDATE or 'shared' for a SELECT
   ... FOR SHARED. If \$scalar is passed, this is taken directly and
   embedded in the query.

with

{
    for => \q{UPDATE SKIP LOCKED}
}

On 4 May 2016, at 12:59, Dmitry Belyavsky wrote:

Hello,

is there a support for the PostgreSQL SELECT FOR UPDATE SKIP LOCKED clause
in the DBIx::Class? And how difficult is to add it if not?

Thank you!

--
SY, Dmitry Belyavsky


List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...


_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...
Reply | Threaded
Open this post in threaded view
|

Re: SELECT ... FOR UPDATE SKIP LOCKED

Francisco Obispo
I’m not sure, but I do know that it wasn’t supported and the most recent re-write introduced it.



On 4 May 2016, at 13:19, Dmitry Belyavsky wrote:

> Dear Francisco, 
> Thank you!
> When did this possibility appeared?

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...

signature.asc (858 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SELECT ... FOR UPDATE SKIP LOCKED

Matthew Somerville
In reply to this post by Dmitry Belyavsky
On 4 May 2016 at 21:19, Dmitry Belyavsky <[hidden email]> wrote:
> When did this possibility appeared?

Looks like it first appeared in 0.08204 (2012-11-08), Changes has:
    * New Features / Changes
        - SQLMaker now accepts \'literal' with the 'for' rs attribute as an
          override to the builtin FOR options

ATB,
Matthew

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...
Reply | Threaded
Open this post in threaded view
|

Re: SELECT ... FOR UPDATE SKIP LOCKED

Dmitry Belyavsky

Thank you! It seems to be old enough for my Debian installations.

4 Май 2016 г. 23:51 пользователь "Matthew Somerville" <[hidden email]> написал:
On 4 May 2016 at 21:19, Dmitry Belyavsky <[hidden email]> wrote:
> When did this possibility appeared?

Looks like it first appeared in 0.08204 (2012-11-08), Changes has:
    * New Features / Changes
        - SQLMaker now accepts \'literal' with the 'for' rs attribute as an
          override to the builtin FOR options

ATB,
Matthew

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...