Re: [Dbix-class] Lazy Columns

2010-05-12 Thread Peter Rabbitson
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

Re: [Dbix-class] Wrong UTF-8 handling in DBIx::Class/DBD::mysql despite mysql_enable_utf8

2010-05-12 Thread Marc Mims
* Matias E. Fernandez pi...@gmx.ch [100512 04:36]: This is about The Unicode Bug [2] and will cause the following test to fail: my $title = \x{e4}\x{f6}\x{fc}; # äöü This isn't a UTF-8 string. utf8::is_utf8($title); # false utf8::upgrade($title); # now it is $album-title($title);

Re: [Dbix-class] Wrong UTF-8 handling in DBIx::Class/DBD::mysql despite mysql_enable_utf8

2010-05-12 Thread Matias E. Fernandez
Hello Marc On 2010-05-12, at 15:40, Marc Mims wrote: my $title = \x{e4}\x{f6}\x{fc}; # äöü This isn't a UTF-8 string. utf8::is_utf8($title); # false utf8::upgrade($title); # now it is It is a string consisting of the three characters \x{e4}, \x{f6} and \x{fc}. That's about all I

Re: [Dbix-class] Lazy Columns

2010-05-12 Thread Peter Rabbitson
Bill Moseley wrote: On Wed, May 12, 2010 at 1:08 AM, Peter Rabbitson rabbit+d...@rabbit.us mailto:rabbit%2bd...@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

[Dbix-class] Should DBIC prefix the table alias on columns in a WHERE?

2010-05-12 Thread Bill Moseley
I've discussed this on irc, and have worked around the issue I had, but I'm still curious. The docs for current_source_alias seems to indicate that the alias will always be me. -- or that it may be in the future. And I'm not clear alias is a valid attribute. That said there's this code: my

Re: [Dbix-class] Lazy Columns

2010-05-12 Thread Bill Moseley
On Wed, May 12, 2010 at 7:46 AM, Peter Rabbitson rabbit+d...@rabbit.usrabbit%2bd...@rabbit.us wrote: \ 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

Re: [Dbix-class] Wrong UTF-8 handling in DBIx::Class/DBD::mysql despite mysql_enable_utf8

2010-05-12 Thread Marc Mims
* Matias E. Fernandez pi...@gmx.ch [100512 07:43]: On 2010-05-12, at 15:40, Marc Mims wrote: my $title = \x{e4}\x{f6}\x{fc}; # äöü This isn't a UTF-8 string. utf8::is_utf8($title); # false utf8::upgrade($title); # now it is It is a string consisting of the three

Re: [Dbix-class] Should DBIC prefix the table alias on columns in a WHERE?

2010-05-12 Thread Peter Rabbitson
Bill Moseley wrote: my $rs1 = $schema-resultset( 'Artist' )-search( { id = 3 } ); print Dumper $rs1-as_query; ... So, my question is should (or can??) DBIC add the alias to the id in the WHERE? The problem, of course, is if there's a join with another table that also has an id

Re: [Dbix-class] Should DBIC prefix the table alias on columns in a WHERE?

2010-05-12 Thread Peter Rabbitson
Bill Moseley wrote: I've discussed this on irc, and have worked around the issue I had, but I'm still curious. The docs for current_source_alias seems to indicate that the alias will always be me. -- or that it may be in the future. And I'm not clear alias is a valid attribute. Addendum:

[Dbix-class] [Fwd: Re: [Catalyst] db delete]

2010-05-12 Thread Stuart Dodds
This message is being forwarded to this mailing list from the Catalyst mailing list as i was told it had more relevance here...does anybody have any ideas? Hi, I recently updated all the Catalyst and DBIC modules on my system and afterwards i started having problems performing deletes in the

[Dbix-class] Searching by related field value

2010-05-12 Thread Sir Robert Burbridge
Hey all, I'm having a (probably?) simple problem that I just don't *quite* grok: How do I search for a row based on properties of an foreign key property's sub-property? That is, if I have two tables like these: CREATE TABLE `vote` ( `id` int(64) NOT NULL auto_increment, `document`

Re: [Dbix-class] Should DBIC prefix the table alias on columns in a WHERE?

2010-05-12 Thread Bill Moseley
On Wed, May 12, 2010 at 9:48 AM, Peter Rabbitson rabbit+d...@rabbit.usrabbit%2bd...@rabbit.us wrote: So, my question is should (or can??) DBIC add the alias to the id in the WHERE? The problem, of course, is if there's a join with another table that also has an id column. No. You

Re: [Dbix-class] Should DBIC prefix the table alias on columns in a WHERE?

2010-05-12 Thread Bill Moseley
BTW - On Wed, May 12, 2010 at 9:48 AM, Peter Rabbitson rabbit+d...@rabbit.usrabbit%2bd...@rabbit.us wrote: Then can do this: my $artist_rs = $schema-resultset('Artist')-search( { 'me.id http://me.id' = $id }, { join = 'label' }, ) $artist_rs = add_label_check(

Re: [Dbix-class] Wrong UTF-8 handling in DBIx::Class/DBD::mysql despite mysql_enable_utf8

2010-05-12 Thread Matias E. Fernandez
Hi again On 2010-05-12, at 17:16, Marc Mims wrote: It is a string consisting of the three characters \x{e4}, \x{f6} and \x{fc}. That's about all I have to know as a Perl user, reread [1] if in doubt. The important thing to know is that you cannot rely on Perl internally holding strings in

Re: [Dbix-class] Wrong UTF-8 handling in DBIx::Class/DBD::mysql despite mysql_enable_utf8

2010-05-12 Thread Nick Wellnhofer
On 12/05/10 23:25, Matias E. Fernandez wrote: Not quite. I get back decoded UTF-8 data, yes! That's why you'll find sv_utf8_decode in the DBD::mysql source, but nowhere do you find an encode! This looks like a bug in DBD::mysql. Nick ___ List:

Re: [Dbix-class] Wrong UTF-8 handling in DBIx::Class/DBD::mysql despite mysql_enable_utf8

2010-05-12 Thread Marc Mims
* Matias E. Fernandez pi...@gmx.ch [100512 14:29]: On 2010-05-12, at 17:16, Marc Mims wrote: It is a string consisting of the three characters \x{e4}, \x{f6} and \x{fc}. That's about all I have to know as a Perl user, reread [1] if in doubt. The important thing to know is that you

[Dbix-class] seeming error in Manual's CD db example

2010-05-12 Thread Darren Duncan
Hello, If you look at http://search.cpan.org/dist/DBIx-Class/lib/DBIx/Class/Manual/Example.pod , I am seeing what appears to be an error in the example, in this block package MyDatabase::Main::Result::Cd; use base qw/DBIx::Class::Core/;

[Dbix-class] DBIx::Class::Validation exceptions

2010-05-12 Thread Ton Voon
Hi! I'm using DBIx::Class::Validation on our Catalyst app (http://opsview.org ) and I've come across a bug which affects exceptions from an eval. If I run an eval { txn_do() } which includes a create/update and DBIx::Class::Validation gives an error, then $@ holds the exception, which is

Re: [Dbix-class] seeming error in Manual's CD db example

2010-05-12 Thread Darren Duncan
Darren Duncan wrote: http://search.cpan.org/dist/DBIx-Class/lib/DBIx/Class/Manual/Example.pod Generally speaking, I'm coming up with a number of clean-up ideas with the above, where I mentioned one already, and here's another: It seems that the terms 'album' and 'cd' are being used