Re: [RDBO] Further discussion re: "How to do locking wth RDBO" thread.

2007-10-10 Thread George Hartzell
John Siracusa writes: > On 10/10/07, George Hartzell <[EMAIL PROTECTED]> wrote: > > - As written, it almost works. I'm clearly running around behind > > the back of RDBO's copy of that row's values, $new_num->counter is > > still zero

[RDBO] Further discussion re: "How to do locking wth RDBO" thread.

2007-10-10 Thread George Hartzell
Back in December '06 there was a thread about "How to do locking in RDBO". It started here: http://osdir.com/ml/lang.perl.modules.dbi.rose-db-object/2006-12/msg00028.html I'm trying to solve a very similar problem and while I have several versions of things that limp along, I'm sure that I co

[RDBO] guessing method name for many-to-many counting method.

2007-08-15 Thread George Hartzell
I have a many-to-many relationship between a pair of tables, using a mapping table, that Rose::DB::Object::Loader sets up properly for me. I can use (e.g.) $widget->add_colors($a_color) to add colors to the widget, so I think it's working right. I'd like to get a count of the number of colors as

Re: [RDBO] help specifying a default datetime with SQLite and RDBO::Loader

2007-08-15 Thread George Hartzell
John Siracusa writes: > On 8/14/07, George Hartzell <[EMAIL PROTECTED]> wrote: > > The default value of "now" does work when used in the RDBO perl > > module. The problem is that since I'm using RDBO::Loader, the only > > way to get that value

Re: [RDBO] help specifying a default datetime with SQLite and RDBO::Loader

2007-08-14 Thread George Hartzell
John Siracusa writes: > On 8/7/07 5:12 PM, George Hartzell wrote: > > If I change Rose::DB::SQLite::validate_datetime_keyword so that it'll > > accept 'current_timestamp' > > Yeah, I should do that... > > > then the value gets inserted lite

[RDBO] help specifying a default datetime with SQLite and RDBO::Loader

2007-08-07 Thread George Hartzell
The following little fragment of sql does what I'd like it to do, inserts the current timestamp into the created_date column. create table mooses ( id integer primary key autoincrement, name text, created_date datetime not null default current_timestamp ); insert int

[RDBO] Who uses SQLite? [was Re: DBD::SQLite and active ...]

2007-08-03 Thread George Hartzell
Michael Lackhoff writes: > On 01.08.2007 17:43 George Hartzell wrote: > > > I think we may have gone over this, but I can't find it in the list. > > > > I'm using current versions of Rose::DB::Object and friends on a > > Freebsd -STABLE system. I&#x

[RDBO] DBD::SQLite and active statement handles.

2007-08-01 Thread George Hartzell
Hi all, I think we may have gone over this, but I can't find it in the list. I'm using current versions of Rose::DB::Object and friends on a Freebsd -STABLE system. I'm using sqlite 3.3.17 and DBD::SQLite 1.13. When I new up an object and save it, I get the following message: closing dbh wi

[RDBO] bug and/or sharp rusty edge in rdbo::Loader and/or relationships.

2007-02-17 Thread George Hartzell
Hi John (and everyone), I just figured out why I wasn't getting an automatically generated add_ method in one of my classes. It turned out that Loader wasn't generating the appropriate relationship. Long story short, I had a table named "set", and another named "set_member", one set can have ma

Re: [RDBO] How to use Rose::DB::Object::{Loader, Helpers} at the same time?

2007-02-16 Thread George Hartzell
George Hartzell writes: > > I have a bunch of classes that are created automagically for me by > Rose::DB::Object::Loader. > > In one of those classes I'd like to use load_or_insert from > Rose::DB::Object::Helpers. > > I'm not sure how to do it polite

[RDBO] How to use Rose::DB::Object::{Loader, Helpers} at the same time?

2007-02-16 Thread George Hartzell
I have a bunch of classes that are created automagically for me by Rose::DB::Object::Loader. In one of those classes I'd like to use load_or_insert from Rose::DB::Object::Helpers. I'm not sure how to do it politely. Just for grins, I tried this: use Rose::DB::Object::Loader; package Foo::DB::

Re: [RDBO] (no subject)

2006-12-09 Thread George Hartzell
Danial Pearce writes: > > depending on your database support, I think the best solution would > > be to use a DB trigger on insert , that would just populate all of > > the fields > > As John says somewhere in the documentation. If you are putting > triggers on your DB, why wouldn't you put

Re: [RDBO] How to do locking with RDBO?

2006-12-05 Thread George Hartzell
Ask Bjørn Hansen writes: > > On Dec 5, 2006, at 9:00, George Hartzell wrote: > > > On the other hand the hoops that they jump through to try to > > automagically generate queries and hide the relational database > > mystifies me, I find that I end up double

Re: [RDBO] How to do locking with RDBO?

2006-12-05 Thread George Hartzell
Michael Lackhoff writes: > On 5 Dec 2006 at 11:02, Perrin Harkins wrote: > > > You can usually do this kind of ++ thing in one INSERT...SELECT statement: > > > > INSERT INTO invoice (id) SELECT MAX(id)+1 FROM invoice; > > That's clever! Though it seems to slightly defeat the point in usin

Re: [RDBO] RDBO and Storable?

2006-12-04 Thread George Hartzell
Peter Karman writes: > > > Peter Leonard scribbled on 12/4/06 1:57 PM: > > > > > I understand the complexity involved, and what we're looking for is the > > quick storage & retrieval of the underlying data - I'll look at the > > json/yaml serialization implementations. > > > >

Re: [RDBO] Rose::DB::Object thingy like class::dbi's set_sql?

2006-11-29 Thread George Hartzell
John Siracusa writes: > On 11/28/06, George Hartzell <[EMAIL PROTECTED]> wrote: > > John Siracusa writes: > >> [...] > >> All of that said, adding iterator options to get_objects_from_sql() > >> and make_manager_method_from_sql() is pretty simple.

Re: [RDBO] Rose::DB::Object thingy like class::dbi's set_sql?

2006-11-28 Thread George Hartzell
John Siracusa writes: > [...] > All of that said, adding iterator options to get_objects_from_sql() > and make_manager_method_from_sql() is pretty simple. If you really > want it, I'll throw it in the next release :) It'd help a bunch. I may take a stab at it, but if you get it going, I'd lo

Re: [RDBO] Rose::DB::Object thingy like class::dbi's set_sql?

2006-11-28 Thread George Hartzell
George Hartzell writes: > > Hi All [and John], > > [...] > It looks like I might be able to figure out how to get RDO::Manager to > express the query, but it would be quicker (at least as a first cut to > be able to do something like > > Foo::DB::Moose::Man

[RDBO] Rose::DB::Object thingy like class::dbi's set_sql?

2006-11-28 Thread George Hartzell
Hi All [and John], I'm exploring Rose::DB::Object et al.. I'm familiar with Class::DBI and have messed around a bit (and decided not to adopt) with DBIX::Class. I'm working with a fairly large database that contains data handed to me as XML with minimal documentation. I've reverse engineered a