Re: [Dbix-class] join ON *AND*

2014-02-21 Thread Carl Franks
On 21 February 2014 09:40, Moritz Lenz wrote: > > When I recently asked the same question on IRC, that was the answer I got: > you need to add new relationship and specify that in the join. Hi, Thanks - I finally figured out that I had to define the relationship $cond as a sub-ref - to get aroun

Re: [Dbix-class] join ON *AND*

2014-02-21 Thread Carl Franks
On 21 February 2014 09:22, Hartmaier Alexander wrote: > Just restrict the resultset: > ->search({ > 'response_comments.alert' => 1, > 'response_comments.status => 'posted', > }, { > ... > }); > Hi, Thanks for the response. Unfortunately, that adds the clause after a "WHERE", which causes

[Dbix-class] join ON *AND*

2014-02-21 Thread Carl Franks
Hi, I can't figure out the DBIx::Class syntax for a JOIN ON x AND y statement. I have a table: query = id title with a has_many() relationship to the table: response_comment id query_id alert posted I want to retrieve all rows from `query`, and a count of the related `resp

Re: [Dbix-class] how do resultsets actually work under the hood?

2013-05-28 Thread Carl Franks
Hi Iain, Setting the ENV variable DBIC_TRACE=1 will cause all statements to be printed to STDERR. - This should show whether it's requesting each row from the db individually. The DBIC docs also show how to send the trace to a file (I forget offhand how it's done). Hope this helps, Carl On 28 May

[Dbix-class] Re: Schema::Versioned error under DBIC v0.08112

2009-10-14 Thread Carl Franks
2009/10/13 Carl Franks : > I don't know which version of DBIx::Class this application last ran > successfully under - but running 0.08112 I'm getting the following > error message: > > Couldn't instantiate component "CAMS::CMS::Model::CMS", "Could not &

[Dbix-class] Schema::Versioned error under DBIC v0.08112

2009-10-13 Thread Carl Franks
I don't know which version of DBIx::Class this application last ran successfully under - but running 0.08112 I'm getting the following error message: Couldn't instantiate component "CAMS::CMS::Model::CMS", "Could not load class (CMS::Schema) because : Can't use string ("CMS::Schema") as a HASH ref

[Dbix-class] Re: SQL error under 0.08108 or higher

2009-09-02 Thread Carl Franks
After some discussion on irc, ribasushi++ has applied a fix for this in svn. Thanks, Carl 2009/8/31 Carl Franks : > I've got some code that's started throwing an exception after > ugprading DBIx-Class from 0.08107 to 0.08108 or higher. > > The error only occurs under MySQ

[Dbix-class] Fwd: how to determine column is inflatable?

2009-09-02 Thread Carl Franks
k? Cheers, Carl -- Forwarded message ------ From: Carl Franks Date: 2009/5/21 Subject: Re: how to determine column is inflatable? To: dbix-class mailing list 2009/1/29 Carl Franks : > Is it okay to use $result_source->column_info('name')->{_inflate_info} > to tes

[Dbix-class] SQL error under 0.08108 or higher

2009-09-02 Thread Carl Franks
I've got some code that's started throwing an exception after ugprading DBIx-Class from 0.08107 to 0.08108 or higher. The error only occurs under MySQL (v3.23.49) - it runs without error using SQLite. Under 0.08107, the generated SQL used an explicit LEFT JOIN: SELECT COUNT( * ) FROM group_rel me

Re: [Dbix-class] add_unique_constraint

2009-06-04 Thread Carl Franks
2009/6/3 Ascii King : > I am a rookie programmer trying to set up a web database. I am having > trouble understanding how to get the add_unique_constraint working. I am > using Catalyst and FormFu and I cannot get the method working as i expect. I > added the following line to my Schema file: > > #

[Dbix-class] Re: how to determine column is inflatable?

2009-05-21 Thread Carl Franks
2009/1/29 Carl Franks : > Is it okay to use $result_source->column_info('name')->{_inflate_info} > to test whether a column is inflatable / deflatable? > It seems a bit too reliant on internals, to me. > > Or should there be a has_inflatable_column('name'

Re: [Dbix-class] how to determine column is inflatable?

2009-01-30 Thread Carl Franks
2009/1/30 Ash Berlin : > > On 30 Jan 2009, at 08:56, Carl Franks wrote: > >> 2009/1/29 Ash Berlin : >>> >>> On 29 Jan 2009, at 22:03, Carl Franks wrote: >>> >>>> Is it okay to use $result_source->column_info('name')->{_inflate_i

Re: [Dbix-class] how to determine column is inflatable?

2009-01-30 Thread Carl Franks
2009/1/29 Ash Berlin : > > On 29 Jan 2009, at 22:03, Carl Franks wrote: > >> Is it okay to use $result_source->column_info('name')->{_inflate_info} >> to test whether a column is inflatable / deflatable? >> It seems a bit too reliant on i

[Dbix-class] how to determine column is inflatable?

2009-01-29 Thread Carl Franks
Is it okay to use $result_source->column_info('name')->{_inflate_info} to test whether a column is inflatable / deflatable? It seems a bit too reliant on internals, to me. Or should there be a has_inflatable_column('name') method? (and is that what it should be called? do we really also need a 'h

Re: [Dbix-class] Re: DBIx::Class::ResultSet::RecursiveUpdate - announcement and RFC

2008-10-02 Thread Carl Franks
2008/10/2 Zbigniew Lukasiak <[EMAIL PROTECTED]>: > On Thu, Oct 2, 2008 at 2:40 AM, Matt S Trout <[EMAIL PROTECTED]> wrote: >> On Wed, Oct 01, 2008 at 09:38:07AM +0200, Zbigniew Lukasiak wrote: >>> The example that I am mostly concerned with is: >>> >>> $cd_rs->recursive_update( { title => 'New Titl

Re: [Dbix-class] patch: escaping user input - cookbook example

2008-02-07 Thread Carl Franks
On 07/02/2008, Matt S Trout <[EMAIL PROTECTED]> wrote: > On Wed, Feb 06, 2008 at 01:14:22PM +0000, Carl Franks wrote: > > On 06/02/2008, Matt S Trout <[EMAIL PROTECTED]> wrote: > > > On Wed, Feb 06, 2008 at 10:34:09AM +, Carl Franks wrote: > > > > Her

Re: [Dbix-class] patch: escaping user input - cookbook example

2008-02-06 Thread Carl Franks
On 06/02/2008, Matt S Trout <[EMAIL PROTECTED]> wrote: > On Wed, Feb 06, 2008 at 10:34:09AM +0000, Carl Franks wrote: > > Here's a minor patch to address an issue that I found a solution for > > in the list archives, but couldn't find in the docs anyw

[Dbix-class] patch: escaping user input - cookbook example

2008-02-06 Thread Carl Franks
Here's a minor patch to address an issue that I found a solution for in the list archives, but couldn't find in the docs anywhere. It's against http://dev.catalyst.perl.org/repos/bast/DBIx-Class/0.08/trunk if it should be against a different location and doesn't patch cleanly, let me know and I'll

Re: [Dbix-class] A more accurate redux of zby's comments

2008-01-24 Thread Carl Franks
On 24/01/2008, Matt S Trout <[EMAIL PROTECTED]> wrote: > On Thu, Jan 24, 2008 at 08:53:08AM +0100, Zbigniew Lukasiak wrote: > > This started with me trying to add some new features to create - they > > were rejected because I was using update_or_create and it does not > > always work, so I went and

[Dbix-class] create() has_one problems

2008-01-14 Thread Carl Franks
I'm unable to use create() to create a new record with a has_one relationship. The docs (ResultSet/create) say: for has_one rels, "pass an arrayref of hashrefs". If I pass an arrayref containing a hashref, like so: $rs->create({ text_col => 'filler2', user => [ { name => 'foo' } ] } ); I

Re: [Dbix-class] How to set callback constraint by yaml file ?

2007-08-28 Thread Carl Franks
On 28/08/07, chylli <[EMAIL PROTECTED]> wrote: > Hi. I strugglle with this problem for a long time. > I want to set a callback constraint on a field, for example, check > whether the username exists in db when user register. The framework is > Catalyst. Now I use HTML::FormFu directly to create a f