[Dbix-class] Lazy Columns
Peter Rabbitson
rabbit+dbic at rabbit.us
Wed May 12 14:46:23 GMT 2010
Bill Moseley wrote:
>
>
> On Wed, May 12, 2010 at 1:08 AM, Peter Rabbitson <rabbit+dbic at rabbit.us
> <mailto:rabbit%2Bdbic at rabbit.us>> wrote:
>
> Bill Moseley wrote:
> >
> > Is this the "blanket increment/decrement" that's referring to?
> >
> > sqlite> update track set pos = pos - 1 where cd = 1 and pos > 2;
> >
>
> No need for where conds and the like. The most minimal test case is
> to create a table with 1 column, with a unique constraint, and put
> in the numbers 1..5. Then try:
>
> UPDATE tab SET col = col + 1;
>
>
> and
>
> UPDATE tab SET col = col - 1;
>
> On sqlite (at least) on of these fails. Not sure for other databases,
> never had the time to test.
>
>
>
> Seems to be the + 1 version.
>
> Postgresql has same "problem."
>
> Most of us work in just one or two databases, so indeed hard to test.
> That's why I was asking about a flag so users can tell dbic the
> approach to use.
Right, and once I get a list of which RDBMS can do what (or at least
a start of such a list) I can add a capability flag to the Storage
layer, and query that.
More information about the DBIx-Class
mailing list