Re: [Dbix-class] bug in delete_all: CascadeActions::delete removes parent before children

2008-10-24 Thread Noel Burton-Krahn
Hi Peter, The problem goes a little deeper: I applied this change to SVN, and immediately saw the 60core.t unit test fail doing deep recursion. Apparently this will break when there's a loop in the relationship graph. So, to avoid the loop, I made a version of delete_all which has loop protectio

Re: [Dbix-class] bug in delete_all: CascadeActions::delete removes parent before children

2008-10-24 Thread Peter Rabbitson
Noel Burton-Krahn wrote: > DBIx's cascading delete_all (in DBIx::Class::ResultSet) it broken, > because it deletes the parent table before it deletes the children. > The database will throw a referential integrity exception when the > parent is deleted before the children.I've attached a test p

[Dbix-class] bug in delete_all: CascadeActions::delete removes parent before children

2008-10-24 Thread Noel Burton-Krahn
DBIx's cascading delete_all (in DBIx::Class::ResultSet) it broken, because it deletes the parent table before it deletes the children. The database will throw a referential integrity exception when the parent is deleted before the children.I've attached a test program below. Here's a fixed ver

Re: [Dbix-class] Nested Selects and Getting SQL from Resultset

2008-10-24 Thread Jess Robinson
On Fri, 24 Oct 2008, Howe, Tom (IT) wrote: I'm trying to do the following i have a table with 3 columns col1, col2 & time I want to create some methods that I can pass dbix resultsets into that will generate new tables the first byMin takes the time field and blanks out the seconds, ge

Re: [Dbix-class] Filtering module

2008-10-24 Thread jackal
On Friday 24 October 2008 17:36:32 Ash Berlin wrote: > Ignoring the usefuless or not of this module: HTML escaping belongs in > template. Yes, ofcourse. It's just an imaginary example. -- Best regards, Eugeny. ___ List: http://lists.scsys.co.uk/cgi-b

Re: [Dbix-class] Filtering module

2008-10-24 Thread Ash Berlin
On 24 Oct 2008, at 13:32, jackal wrote: On Thursday 23 October 2008 20:18:49 Jess Robinson wrote: On Tue, 21 Oct 2008, jackal wrote: This is proposal for a filtering component, similar to DBIx::Class::InflateColumn It can -modify- columns transparently. When you read column - it inflates, whe

Re: [Dbix-class] tinyint and enum mapping

2008-10-24 Thread jackal
On Friday 24 October 2008 17:11:46 Fayland Lam wrote: > hi, folks. > > basically I prefers tinyint better than enum becaue I don't need alter > table when adding another value to col. > > see now we have a column 'status' and it's tinyint instead of enum > then I want my code treats it as enum inst

[Dbix-class] tinyint and enum mapping

2008-10-24 Thread Fayland Lam
hi, folks. basically I prefers tinyint better than enum becaue I don't need alter table when adding another value to col. see now we have a column 'status' and it's tinyint instead of enum then I want my code treats it as enum instead of tinyint. it means I can do something like follows: ->creat

Re: [Dbix-class] Filtering module

2008-10-24 Thread jackal
On Friday 24 October 2008 16:32:07 jackal wrote: > There's example of using module with InflateColumn: > > package DB::Test; > use URI; > __PACKAGE__->inflate_column('homepage', { > inflate => sub { URI->new($_[0]) }, > deflate => sub { shift->as_string } > }); > __PACKAGE__->modify_column(

Re: [Dbix-class] Filtering module

2008-10-24 Thread jackal
On Thursday 23 October 2008 20:18:49 Jess Robinson wrote: > On Tue, 21 Oct 2008, jackal wrote: > > This is proposal for a filtering component, similar to > > DBIx::Class::InflateColumn > > It can -modify- columns transparently. When you read column - it > > inflates, when you write - deflates. > >

[Dbix-class] Nested Selects and Getting SQL from Resultset

2008-10-24 Thread Howe, Tom (IT)
I'm trying to do the following i have a table with 3 columns col1, col2 & time I want to create some methods that I can pass dbix resultsets into that will generate new tables the first byMin takes the time field and blanks out the seconds, generating a new column called 'minutes' the se