[Dbix-class] Example confusion -- my own

2006-06-22 Thread Alex Beamish
Hi,I'm just getting up to speed on DBIx::Class as a precursor to doing Great Things (I hope) with Catalyst. When I do that kind of thing, I like to do all of the examples so I can really understand them. It all makes sense with the exception of the join in the result set call. First, the example

Re: [Dbix-class] Example confusion -- my own

2006-06-22 Thread Alex Beamish
On 6/22/06, Justin Guenther [EMAIL PROTECTED] wrote: On 6/22/06, Alex Beamish [EMAIL PROTECTED] wrote: Here's the first one that has me stumped .. # SELECT me.cdid, me.artist, me.title # FROM cd me #LEFT JOIN track tracks ON ( tracks.cd = me.cdid )#WHERE ( tracks.title = ? ) #(`Stan') sub

Re: [Dbix-class] Example confusion -- my own

2006-06-22 Thread Ash Berlin
Alex Beamish wrote: So join = 'tracks' doesn't mean join to the `tracks' table, it means join to the `tracks' relationship, which happens to exist on the `track' table. Just like in the first example you gave `cd' didn't refer to a table, it referred to a relationship that

Re: [Dbix-class] quote char works with sorting without breaking too much!

2006-06-22 Thread A. Pagaltzis
* Ash Berlin [EMAIL PROTECTED] [2006-06-22 13:50]: As for a go at taking that contrived CASE clause: { case = [ [ age = '' = 18 = 'NULL'], [age = '' = 45 = 'NULL'], ['age'] ] } Possible with WHEN/ELSE keys: { case = [ { where = 'age' = '' = 18 = 'NULL'}, {where = 'age' = '' = 45 =

Re: [Dbix-class] quote char works with sorting without breaking too much!

2006-06-22 Thread Ash Berlin
A. Pagaltzis wrote: * Ash Berlin [EMAIL PROTECTED] [2006-06-22 13:50]: As for a go at taking that contrived CASE clause: { case = [ [ age = '' = 18 = 'NULL'], [age = '' = 45 = 'NULL'], ['age'] ] } Possible with WHEN/ELSE keys: { case = [ { where = 'age' = '' = 18 = 'NULL'}, {where =

Re: [Dbix-class] quote char works with sorting without breaking too much!

2006-06-22 Thread A. Pagaltzis
* Ash Berlin [EMAIL PROTECTED] [2006-06-23 01:40]: A. Pagaltzis wrote: Errm, seriously: you find that more readable than literal SQL? No, just more portable. What if you change the table name but forget to change it one place in your code, or add an age column to another table etc. etc.

Re: [Dbix-class] Example confusion -- my own

2006-06-22 Thread Alex Beamish
On 6/22/06, Ash Berlin [EMAIL PROTECTED] wrote: Alex Beamish wrote: So join = 'tracks' doesn't mean join to the `tracks' table, it means join to the `tracks' relationship, which happens to exist on the `track' table. Just like in the first example you gave `cd' didn't refer to a table, it

[Dbix-class] emulating (or using) MySQL's INSERT...ON DUPLICATE KEY UPDATE...

2006-06-22 Thread Mark Hedges
MySQL has a mod to INSERT where you can do: INSERT key_field = '$key_value', some_field = 1 ON DUPLICATE KEY UPDATE some_field = some_field + 1 In a multi-connection system, this is really handy for the initial insert of some

[Dbix-class] quick question about REPLACE DELAYED table_name SET

2006-06-22 Thread fayland
I get a mysql sentence like REPLACE DELAYED table_name SET a = 'b', c = 'd' how to write this in DBIx-Class. should I get -storage-dbh? Thanks. -- Fayland Lam // http://www.fayland.org/ ___ List: