Re: [Dbix-class] Detecting connection errors

2015-10-14 Thread David Ihnen
here---end--->8--- > > Thanks, > > -- > Alberto > > > ___ > List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class > IRC: irc.perl.org#dbix-class > SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ > Searc

Re: [Dbix-class] How to manage customer-specific / user-defined attributes?

2015-09-27 Thread David Ihnen
), and the normalization approach with > single values attributes. > > Best regards, > Alex > > ___ > List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class > IRC: irc.perl.org#dbix-class > SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ > Searchabl

Re: [Dbix-class] has_many LEFT JOIN with parameter

2011-05-06 Thread David Ihnen
Where $value can be specified as part of the search for the ON condition. > > Is this possible? > > Ton > > > ___ > List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class > IRC: irc.perl.org#dbix-class > SVN: http://dev.catalyst.p

Re: [Dbix-class] Relationship question/database structure

2011-01-10 Thread David Ihnen
Agreed, You are a better expresser than I, apologies for clutzing ther ideas. And I do like my julienned fries. David On Mon, Jan 10, 2011 at 2:10 PM, Rob Kinyon wrote: > On Mon, Jan 10, 2011 at 13:54, David Ihnen wrote: > > Yes. That was what i was typing basically when Mr Kinyon&

Re: [Dbix-class] Relationship question/database structure

2011-01-10 Thread David Ihnen
y named tables with identical fields is better than the current > > approach? > > On 1/10/2011 1:34 PM, David Ihnen wrote: > >> > >> You're not thinking specifically enough. The column which has the ID in > >> it is being used to store disparate types of in

Re: [Dbix-class] Relationship question/database structure

2011-01-10 Thread David Ihnen
The current 'note' table has two columns: > 'TableName' and 'TableId', where the 'TableName' field is an abbreviation > for the name of the table the note is related to, and the 'TableId' is the > record within that table. > > So, it

Re: [Dbix-class] Relationship question/database structure

2011-01-10 Thread David Ihnen
What's the best structure, and how do we go > > about defining the DBIC rels? > > Thanks, > > Steve > > > > ___ > > List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-cl

Re: [Dbix-class] Moose

2010-07-18 Thread David Ihnen
On Sun, Jul 18, 2010 at 2:30 PM, Leandro Hermida wrote: > >>> Hi, very sorry... I was speaking more in general about writing an > OO-centric ORM and that it is difficult topic but that there are very well > established open-source solutions like Hibernate and others in the space > that one could

Re: [Dbix-class] Moose

2010-07-18 Thread David Ihnen
On Sun, Jul 18, 2010 at 1:39 PM, Leandro Hermida wrote: > On Sun, Jul 18, 2010 at 7:49 PM, Peter Rabbitson > > > wrote: > >> On Sun, Jul 18, 2010 at 02:40:47PM +0200, Leandro Hermida wrote: >> > very good points and makes a lot of sense. If I can ask a more general >> > question then, why do O

Re: [Dbix-class] Moose

2010-07-18 Thread David Ihnen
On Sun, Jul 18, 2010 at 7:40 AM, Leandro Hermida wrote: > Hi t0m, > > On Sun, Jul 18, 2010 at 6:22 AM, Tomas Doran wrote: > >> >> On 11 Jul 2010, at 14:48, Leandro Hermida wrote: >> >>> I had a look at KiokuDB, its a very nice project and suitable for >>> certain needs, but it doesn't do ORM. In

Re: [Dbix-class] Multiple ands in where clause

2010-05-28 Thread David Ihnen
Perchane did you try something like this: $rs = $schema->resultset('IncOpcode')->search( { desc => { -like => [ map { '%'.$_.'%' } @TERMS ] }    } ); David On Fri, May 28, 2010 at 12:57 PM, Dennis Daupert wrote: > I need to '-and' a varying number of variables in a > where clause in my appli

Re: [Dbix-class] join to tables has two "identical" columns

2010-03-18 Thread David Ihnen
Set up two different relationships, one describing the relationship to each column specifically, with a join type option of outer. Query a joining across both relationships and constrain by table2left.left is not null or table2right.right is not null Make sense? David On Thu, Mar 18, 2010 at 11

Re: [Dbix-class] Manual Transaction Handling for Sybase ?

2009-07-08 Thread David Ihnen
This really does come down to the fundamental tradeoff previously discussed in various places regarding transactions and autocommit; That is, that the connection is not necessarily monopolized by dbix-class. When it comes 'online' with the connection from whatever pool it came from, there may

Re: [Dbix-class] Shortcut to perform lookups

2009-07-06 Thread David Ihnen
Oye, at least when you're coding you don't make silly ommissions... like not doing create_related. my ($self, $status_obj, $phase_obj) = @_; $self->txn_do( sub { $self->create_related('process', { status => $status_obj, phase => $phase_obj }) } ); } _

Re: [Dbix-class] Shortcut to perform lookups

2009-07-06 Thread David Ihnen
Dan Horne wrote: On 7/07/2009, at 12:43 PM, David Ihnen wrote: Dan Horne wrote: Say I have a table called customer which links to a parent table called status. I wonder if there is a shortcut so that I don't need to figure out the parent id in advance if I know the unique name.

Re: [Dbix-class] Shortcut to perform lookups

2009-07-06 Thread David Ihnen
Dan Horne wrote: Say I have a table called customer which links to a parent table called status. I wonder if there is a shortcut so that I don't need to figure out the parent id in advance if I know the unique name. my $status = $self->schema->resultset('Status')->search({status_name => 'new

Re: [Dbix-class] PATCH: Support for arbitrary SQL in relationship definition

2009-06-30 Thread David Ihnen
Rob Kinyon wrote: Now, if someone can provide a solid use-case, then I'll be onboard. But, adding features for the sake of adding features is how you end up with a crappy API. Rob Lets see if I can argue the use case. I tripped over this limitation and I *think* it was when I was doing this pa

Re: [Dbix-class] PATCH: Support for arbitrary SQL in relationship definition

2009-06-30 Thread David Ihnen
Peter Rabbitson wrote: David Ihnen wrote: Ivan Fomichev wrote: Hello, great module. Instead of arguing if it is a useful patch or not and if it should be applied or there are weird workarounds easily available, just make your own DBIx::Class component and release it on CPAN. Who need

Re: [Dbix-class] PATCH: Support for arbitrary SQL in relationship definition

2009-06-29 Thread David Ihnen
Ivan Fomichev wrote: Hello, great module. Instead of arguing if it is a useful patch or not and if it should be applied or there are weird workarounds easily available, just make your own DBIx::Class component and release it on CPAN. Who need will load this component. Good luck. Ivan. Can you

Re: [Dbix-class] PATCH: Support for arbitrary SQL in relationship

2009-06-29 Thread David Ihnen
Rob Kinyon wrote: On Mon, Jun 29, 2009 at 10:13, Peter Rabbitson wrote: A classical use-case is "right side condition on a left-join". There is no way to emulate those appropriately with WHERE - the condition has to reside in the join spec itself: i.e. you need to get ALL artists, and all cds

Re: [Dbix-class] Resultset relation accessors

2009-06-08 Thread David Ihnen
Matt S Trout wrote: On Tue, May 26, 2009 at 01:49:05PM -0700, David Ihnen wrote: Sometimes I think i'm missing something obvious. In my application, for instance, a holiday can be assigned to a group. A group has many donors A donor might have many scheduled days A scheduled d

Re: [Dbix-class] Problems with DBIx:: and SQL JOIN's

2009-06-08 Thread David Ihnen
Tommy Butler wrote: Friends, I'm having serious pains getting DBIx::Class to JOIN on anything. I'm dealing with one situation in particular, but my problems are not limited to this. I'd like to learn how to fix this one problem so I can go on to fix others. In the description of my problem I

Re: [Dbix-class] add_unique_constraint

2009-06-03 Thread David Ihnen
I can't say I know anything of Catalyst or FormFu, but I do know about web applications and database integrations. What exactly do you mean by "a web database"? Usually people are trying to create some sort of content delivery system on the web, which utilizes a database for data storage. Th

[Dbix-class] Resultset relation accessors

2009-05-26 Thread David Ihnen
Sometimes I think i'm missing something obvious. In my application, for instance, a holiday can be assigned to a group. A group has many donors A donor might have many scheduled days A scheduled day is associated with a particular schedule In this spot in my application, the operation is "updat

[Dbix-class] Null foreign keys and the reload_from_storage error when its not wanted

2009-05-21 Thread David Ihnen
Is this appropriate behavior or a bug? Consider this code here. It is part of our application's database test script. Its purpose is to hit every rel defined in the database so that we can get an early warning on any class configuration mismatching the state of the database. # get all the

Re: [Dbix-class] 0.08103 - subtle testing fail

2009-05-20 Thread David Ihnen
Peter Rabbitson wrote: David Ihnen wrote: fREW Schmidt wrote: On Mon, May 18, 2009 at 5:16 PM, Peter Rabbitson mailto:rabbit%2bd...@rabbit.us>> wrote: Greetings, The next release of DBIC will have a number of exciting improvements, among them proper ->count -&g

Re: [Dbix-class] 0.08103 - subtle testing fail

2009-05-19 Thread David Ihnen
fREW Schmidt wrote: On Mon, May 18, 2009 at 5:16 PM, Peter Rabbitson mailto:rabbit%2bd...@rabbit.us>> wrote: Greetings, The next release of DBIC will have a number of exciting improvements, among them proper ->count ->update and ->delete of any resultset, regardless of it's com

Re: [Dbix-class] 0.08103 - call for testers!

2009-05-18 Thread David Ihnen
Peter Rabbitson wrote: Greetings, The next release of DBIC will have a number of exciting improvements, among them proper ->count ->update and ->delete of any resultset, regardless of it's complexity (join, group_by, paging, etc.) While all of these improvements are logical extensions of the aw

Re: [Dbix-class] Problem with populate() and commits?

2009-05-15 Thread David Ihnen
Peter Rabbitson wrote: David Ihnen wrote: Maybe I should submit it as a patch to DBIx::Class - Sometimes for code quality reasons you actually DO want to trust dbic transactions, even though you've turned off autocommit. (Because if autocommit is on, your application transaction layer

Re: [Dbix-class] Problem with populate() and commits?

2009-05-15 Thread David Ihnen
Louis Erickson wrote: On Thu, 14 May 2009, Chris Cole wrote: Why does it work fine when I have Autocommit 'on', but get the following error with Autocommit 'off': I'm surprised no one else has replied. I must have missed the message. This bit me too when I first started with DBI

Re: [Dbix-class] New user with JOIN problem

2009-05-12 Thread David Ihnen
Chris Cole wrote: Ultimately, the SQL code I want to replicate is: SELECT miRNA_id, sum(abundance) as sum FROM mirbase_hairpin_match, seq_data WHERE query_id = id AND query_id LIKE 'mmuD%' GROUP BY miRNA_id I've tried breaking it down to a simpler SQL for testing: SELECT query_id, miRNA_id, abu

Re: [Dbix-class] DBIx::Class 0.08100 released to CPAN

2009-04-22 Thread David Ihnen
Peter Rabbitson wrote: David Ihnen wrote: Matt S Trout wrote: On Tue, Apr 21, 2009 at 10:59:48AM -0700, David Ihnen wrote: Which is why: ->create_related('ivr_holiday', { holiday => date, description => $description }); is c

Re: [Dbix-class] DBIx::Class 0.08100 released to CPAN

2009-04-22 Thread David Ihnen
Matt S Trout wrote: On Tue, Apr 21, 2009 at 10:59:48AM -0700, David Ihnen wrote: Which is why: ->create_related('ivr_holiday', { holiday => date, description => $description }); is called. but does not create an error on groups when ->create_related(&#

Re: [Dbix-class] DBIx::Class 0.08100 released to CPAN

2009-04-21 Thread David Ihnen
Peter Rabbitson wrote: David Ihnen wrote: So 'does not exist' is not equivalent to 'undef' per the logic in the code? Does something break if they are equivalent? http://search.cpan.org/~mstrout/DBIx-Class-0.08100/lib/DBIx/Class/Row.pm#new 'does not exi

Re: [Dbix-class] DBIx::Class 0.08100 released to CPAN

2009-04-20 Thread David Ihnen
John Napiorkowski wrote: --- On Mon, 4/20/09, David Ihnen wrote: From: David Ihnen Subject: Re: [Dbix-class] DBIx::Class 0.08100 released to CPAN To: "Class user and developer list" Date: Monday, April 20, 2009, 6:18 PM Okay, I have a question playing with this relea

Re: [Dbix-class] DBIx::Class 0.08100 released to CPAN

2009-04-20 Thread David Ihnen
345 BUT - if we *do* put the hash entry in for the relationship tying column (donor_id in this case) - but leave its value undefined - the error does not occur. What do you make of that? David Ihnen Matt S Trout wrote: After possibly the longest and most irritating development cycle

Re: [Dbix-class] Insert or Update (was ANNOUNCE: 0.08099_08)

2009-04-20 Thread David Ihnen
Peter Corlett wrote: On 19 Apr 2009, at 11:14, Matt S Trout wrote: [...] And the patch didn't come with tests, so I assumed he didn't *want* it to be applied ... It was more a prompt for somebody with better inside knowledge of DBIx::Class to take the idea and run with it or suggest a better

Re: [Dbix-class] Question on expressing relationship to one or other table depending on ENUM value

2009-03-25 Thread David Ihnen
This is the 'mutiple join conditions' feature that is wanted by just about everybody but isn't in the system yet, to my understanding. This pattern may work better given the current state of the code - AND forces database constraint checking so you don't accidentally end up putting in a object

Re: [Dbix-class] Incorrect SQL being generated after DBIC library upgrade

2009-03-19 Thread David Ihnen
Anthony Gladdish wrote: Any ideas or suggestions from anyone would be great. Since hashref are ands already, simplyfing it is what I'd do my $orders_current = $schema->resultset('Order')->search( { -or => [ "module_access.expires" => { ">", DateTime->now() }, "sch

Re: [Dbix-class] Newbie question

2009-03-16 Thread David Ihnen
ivan wrote: I wish to realise SQL in DBIx syntax: select * from table1 left join ( select * from table2 where date = 'mydate' ) as F ON ( table1.id = F.table1_id ); Is it possible ? package DB::Schema::table1; __PACKAGE__->load_components(qw/core/); __PACKAGE__->table('table1'); __PACKAGE_

Re: [Dbix-class] Re: Complex(ish) select statement => DBIx::Class method

2009-03-12 Thread David Ihnen
fREW Schmidt wrote: On Thu, Mar 12, 2009 at 10:23 AM, fREW Schmidt > wrote: Hello friends! We'd like to make it a method for the logParent, so one could just do $parent->elapsed_ms or something like that. We are kindav at a loss as to how to do this.

Re: [Dbix-class] Patch submission: Relationship Accessor for null pattern compatibility

2009-03-11 Thread David Ihnen
Peter Rabbitson wrote: David Ihnen wrote: When working with the null pattern classes from Mr. Rabbitson, I discovered this slight ommission that results in getting an undefined, when you're actually wanting a null. That is, even when something is not true, I still want it! It shou

[Dbix-class] Patch submission: Relationship Accessor for null pattern compatibility

2009-03-10 Thread David Ihnen
When working with the null pattern classes from Mr. Rabbitson, I discovered this slight ommission that results in getting an undefined, when you're actually wanting a null. That is, even when something is not true, I still want it! It should be entirely backwards compatible with existing code

Re: [Dbix-class] Set a resultset_class for a result_class from within a component loaded by the result_class

2009-03-05 Thread David Ihnen
Rob Kinyon wrote: On Thu, Mar 5, 2009 at 12:07, David Ihnen wrote: Nothing is actually a plugin that impliments the 'Nothing' design pattern - that is - instead of returning null when referencing a row in an empty resultset (particularly ->single and ->first,

Re: [Dbix-class] Set a resultset_class for a result_class from within a component loaded by the result_class

2009-03-05 Thread David Ihnen
For these purposes I found this sneaky little ResultSetManager extension. You put ResultSetManager in your load_components and you put your custom plugin for resultset into a load_resultset_components call. An example from one of my classes. __PACKAGE__->load_components(qw/IVRSchedule PK::Au

Re: [Dbix-class] Fun with auto-restricted result sets

2009-02-18 Thread David Ihnen
Jason Gottshall wrote: David Ihnen wrote: So in the wake of fREW showing a modification of the classes to allow the modification of the delete, I utilized a corrollary concept... restricting a result set automatically/transparently, as you would in case of that delete - not normally showing

[Dbix-class] Fun with auto-restricted result sets

2009-02-18 Thread David Ihnen
So in the wake of fREW showing a modification of the classes to allow the modification of the delete, I utilized a corrollary concept... restricting a result set automatically/transparently, as you would in case of that delete - not normally showing the deleted rows. In my case, my alerts tabl

Re: [Dbix-class] "soft deletion"

2009-02-17 Thread David Ihnen
I wrote a blog post on the specifics of my method. http://blog.afoolishmanifesto.com/archives/274. The only things that are missing are a) configurability and b) a way to find deleted rows. The first is just a matter of me reading the source code of more Components, the second seems harder

Re: [Dbix-class] "soft deletion"

2009-02-16 Thread David Ihnen
fRew I bet you could create a plugin to do what you wanted by layering between dbix-class and the database. You'd override insert/update/delete in the plugin to do the changes you want, and you'd add your exclusionary term to all of the searches unless indicated otherwise... David __

Re: [Dbix-class] "soft deletion"

2009-02-16 Thread David Ihnen
fREW Schmidt wrote: To make myself more clear, I'd like either a binary flag or a date which would probably be called deleted or date_deleted or is_deleted (feel free to give input in this) and I'd like it not to show up in regular resultsets unless I explicitly say I want to see the deleted ro

Re: [Dbix-class] Weird search issue

2009-02-12 Thread David Ihnen
Looks like an encoding problem, fREW. You might notice its not a dot *between* - its a dot *after* each letter. The data is being sent in as something like 16 bit unicode, and is being serialized out without taking that into account. I wish I knew the solution, but I hope that provides a lea

Re: [Dbix-class] Call for testers

2009-02-09 Thread David Ihnen
Peter Rabbitson wrote: Greetings, In order to resolve a cpan dependency deadlock, we prepared a forward-compatible version of DBIC 0.08011. Keep in mind that this is _not_ the long awaited 0.08100 release, so do not expect any new features. In fact it strives to be bug-for-bug compatible with 0

Re: [Dbix-class] Get a list of parent objects based on child object properties (possible n00bish question)

2009-02-04 Thread David Ihnen
Heiko Gruner wrote: Hello, i tried to hardcode values into a table relationship like below. But i just received just errors like "undef error - Invalid rel cond val" That sucks, eh Heiko? Yes, what I was saying below is "I know what you mean and this is how I want it to work, but it does not

Re: [Dbix-class] Get a list of parent objects based on child object properties (possible n00bish question)

2009-02-03 Thread David Ihnen
attribute " . $_->project_attributes->attribute_values->name . "\n" foreach (@rows); And though you had to mention what direction of joins to take (there can be many in a complex schema!) to use for the query, you did NOT have to define which columns are utilized for eac

[Dbix-class] Insert/create uses store not set column?

2009-01-23 Thread David Ihnen
In my work creating a plugin whose purpose was to audit changes and creations to table data. My auditing plugin inserted itself after the main set_column stage, checked the dirty flag, and recorded the change for audit (at final insert time) when the column was dirty after the set. This didn