On Nov 26, 2007, at 5:29 PM, maxim wrote:
> It would be nice to have abstraction layer for SQL query itself.
Yeah, no kidding :) I've got ideas for one but so far not enough time
to dedicate to it.
> Something like:
>
> my $query = Rose::DB::TableName::Manager->getSelect();
> $query->someField->setCondition(eq => 'somename') if
> $query->can("someField");
> $query->anotherField->addCondition(lt => '1000') if
> $query->can("anotherField");
> $query->anotherField->addCondition( gt => '0') if
> $query->can("anotherField");
>
> my $iterator = $query->get_iterator();
> ------------------------------------------------
> Or may be you can point me to the proper technique to follow with
> current
> implementation.
There's nothing so nice. I suppose you could simulate it by building
up Perl data structures suitable for passing in a get_objects() query
parameter (i.e., value/hashref pairs and so on) but that's not quite
the same thing.
> Also, is it possible to support XPath based sql queries. (like for
> example
> '/dbname:[EMAIL PROTECTED] = "somevalue" and @field2 > "1000"]' )
> It might lead to some interesting applications where direct mapping
> from
> some XML chunk is one of thoughts.
I think we need a nice mutable object representation of SQL first,
then the same thing for a generic set of result objects. Then maybe
after that we can think about translating from one query syntax to
another.
-John
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Rose-db-object mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rose-db-object