Re: [RDBO] suggestions for enchancement

2007-12-04 Thread David Lloyd

big snip

Ok, so does Hibernate from the Java World, or JPA from Jave EE 3.0 
actually do what we want? I suspect it does...

DSL

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


Re: [RDBO] suggestions for enchancement

2007-11-28 Thread Perrin Harkins
On Nov 27, 2007 11:21 PM, David Lloyd [EMAIL PROTECTED] wrote:
 Ron Savage wrote:
  You mean like SQL::Abstract?
  http://search.cpan.org/~nwiger/SQL-Abstract-1.22/

 I was thinking the same thing...does that not do what the OP wishes it to?

SQL::Abstract is very limited.  It doesn't even handle joins.  The
query builder class already in RDBO supports a lot more capabilities
of SQL than SQL::Abstract does.

- Perrin

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


Re: [RDBO] suggestions for enchancement

2007-11-27 Thread John Siracusa
On Nov 27, 2007, at 12:50 AM, Ron Savage wrote:
 On Tue, 2007-11-27 at 00:15 -0500, John Siracusa wrote:
 I think we need a mutable object representation of SQL first, the the

 You mean like SQL::Abstract?

No, definitely not like SQL::Abstract :)  SQLA provides a very limited  
set of features: feed in Perl data structures and get out an SQL  
string and some bind values.  I want something a lot more flexible.   
It's like the difference between producing HTML forms using CGI.pm and  
doing the same thing using Rose::HTML::Objects.  I want a generic tree  
of mutable objects (cross-linked to the relevant bits of table  
metadata so they can be smart) that only serializes to an SQL string  
on demand at the very end of the process.

-John

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


Re: [RDBO] suggestions for enchancement

2007-11-27 Thread John Siracusa
On Nov 27, 2007 9:29 AM, Peter Karman [EMAIL PROTECTED] wrote:
 fwiw, the DBIC folks have been discussing this very topic lately:

 http://lists.scsys.co.uk/pipermail/dbix-class/2007-November/005320.html

I know.  I'm on that list too :)

-John

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


Re: [RDBO] suggestions for enchancement

2007-11-27 Thread maxim
 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On 
 Behalf Of Perrin Harkins
 Sent: Tuesday, November 27, 2007 12:19 PM
 To: rose-db-object@lists.sourceforge.net
 Subject: Re: [RDBO] suggestions for enchancement
 
 On Nov 26, 2007 11:39 PM, John Siracusa [EMAIL PROTECTED] wrote:
  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.
 
 That's what I've done and it's been fine so far.  A simple 
 object wrapper for that sounds nice though.
 
  thats what I am using too but its not nice.
 
 Replacing SQL with a different query syntax doesn't sound 
 very useful to me.  It just makes it harder to debug your queries.
 

its useful when you have XML based framework where your backend is 
trying to reflect some XML schema and you dont what to remap XML on the DB
schema but just using it.
For example if API is XML centric then one will end up with deep tree of XML
elements and mapping
some SQL backend would be a not to easy task. In case of SQL centric API the
neccesity to work with too flat
data strcutures will result in very cubersome toXML/fromXML code. I am
trying to find a golden rule here.
   
--Maxim


 - Perrin
 
 --
 ---
 This SF.net email is sponsored by: Microsoft Defy all 
 challenges. Microsoft(R) Visual Studio 2005.
 http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
 ___
 Rose-db-object mailing list
 Rose-db-object@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/rose-db-object
 



-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


Re: [RDBO] suggestions for enchancement

2007-11-27 Thread Perrin Harkins
On Nov 27, 2007 2:41 PM, maxim [EMAIL PROTECTED] wrote:
 its useful when you have XML based framework where your backend is
 trying to reflect some XML schema and you dont what to remap XML on the DB
 schema but just using it.

If you really want to use XML for your backend storage, I'd suggest
using something built for that purpose like XML::Comma or a database
with XML support.  MySQL 5.1 has built-in XPath queries, and I'm sure
someone must have built a Postgres extension for it too.  Oracle has
had it for about a decade.

- Perrin

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


Re: [RDBO] suggestions for enchancement

2007-11-27 Thread Sean Davis
On Nov 27, 2007 3:19 PM, Perrin Harkins [EMAIL PROTECTED] wrote:
 On Nov 27, 2007 2:41 PM, maxim [EMAIL PROTECTED] wrote:
  its useful when you have XML based framework where your backend is
  trying to reflect some XML schema and you dont what to remap XML on the DB
  schema but just using it.

 If you really want to use XML for your backend storage, I'd suggest
 using something built for that purpose like XML::Comma or a database
 with XML support.  MySQL 5.1 has built-in XPath queries, and I'm sure
 someone must have built a Postgres extension for it too.  Oracle has
 had it for about a decade.


Just cause it came up, prior to 8.3, there is the xml2 contrib module
for Postgres.  Postgres 8.3, currently in what is likely to be final
beta, has built-in xml datatype and allows xpath queries on columns of
xml datatype.

Sean

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


Re: [RDBO] suggestions for enchancement

2007-11-26 Thread John Siracusa
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/vse012070mrt/direct/01/
___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


Re: [RDBO] suggestions for enchancement

2007-11-26 Thread John Siracusa
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 to get_objects() (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 mutable object representation of SQL first, the the same
thing for a set of results.  Then maybe after that we can think about
translating from one query syntax (e.g., XPath) to another.
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


Re: [RDBO] suggestions for enchancement

2007-11-26 Thread Ron Savage
On Tue, 2007-11-27 at 00:15 -0500, John Siracusa wrote:

Hi John



 I think we need a mutable object representation of SQL first, the the 

You mean like SQL::Abstract?
http://search.cpan.org/~nwiger/SQL-Abstract-1.22/

-- 
Ron Savage
[EMAIL PROTECTED]
http://savage.net.au/index.html



-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object