Re: [RDBO] Relationships and queries across multiple databases

2007-10-01 Thread Kurt Hansen
Hello,

Hmm...I'm not sure if the lack of response on this question is because 
no-one is doing this, it isn't possible within RDBO, my e-mail was last, 
or my question was incoherent.

While the incoherence of the message is a definite possibility -- :-), 
even knowing this isn't possible within RDBO would be most helpful!

Thanks!

Kurt

Kurt Hansen wrote:
 Hello,

 I'd like to be able to setup relationships and do queries across two 
 databases.

 The archives of this mailing list suggests this is possible with 
 mentions of supports_schema and a schema parameter call in the 
 Rose::DB-register_db call.

 Unfortunately, the details of how to do this have avoided my muddled 
 brain even though I have tried to capture them by searching the docs, 
 searching via Google, and experimentation.

 My database is MySQL.

 Any help, including a pointer to where in the docs I should have found 
 it, would be much appreciated. :-)

 Take care,

 Kurt Hansen
 [EMAIL PROTECTED]

-
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] Relationships and queries across multiple databases

2007-10-01 Thread Kurt Hansen
John Siracusa wrote:
 On 10/1/07 1:17 PM, Kurt Hansen wrote:
   
 Hmm...I'm not sure if the lack of response on this question is because
 no-one is doing this, it isn't possible within RDBO, my e-mail was last,
 or my question was incoherent.

 While the incoherence of the message is a definite possibility -- :-),
 even knowing this isn't possible within RDBO would be most helpful!
 

 Have you tried simply setting the schema attribute of your Rose::DB data
 sources?

 -John

   
Yes, I've done the following:

__PACKAGE__-register_db(
  domain   = 'pax',
  type = 'donor',
 ...
  schema   = '1',
);

I tried it, and it didn't seem to work. I also tried setting the schema 
to the database name and that didn't work either.

What should I be doing?

Thanks!

Take care,

Kurt

 Kurt Hansen wrote:
 
 Hello,

 I'd like to be able to setup relationships and do queries across two
 databases.

 The archives of this mailing list suggests this is possible with
 mentions of supports_schema and a schema parameter call in the
 Rose::DB-register_db call.

 Unfortunately, the details of how to do this have avoided my muddled
 brain even though I have tried to capture them by searching the docs,
 searching via Google, and experimentation.

 My database is MySQL.

 Any help, including a pointer to where in the docs I should have found
 it, would be much appreciated. :-)

 Take care,

 Kurt Hansen
 [EMAIL PROTECTED]
   

-
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


[RDBO] Relationships and queries across multiple databases

2007-09-26 Thread Kurt Hansen
Hello,

I'd like to be able to setup relationships and do queries across two 
databases.

The archives of this mailing list suggests this is possible with 
mentions of supports_schema and a schema parameter call in the 
Rose::DB-register_db call.

Unfortunately, the details of how to do this have avoided my muddled 
brain even though I have tried to capture them by searching the docs, 
searching via Google, and experimentation.

My database is MySQL.

Any help, including a pointer to where in the docs I should have found 
it, would be much appreciated. :-)

Take care,

Kurt Hansen
[EMAIL PROTECTED]

-
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] Remote DB connection over SSL to MySQL DB using Rose::DB

2007-09-03 Thread Kurt Hansen
John Siracusa wrote:
 On 8/26/07 11:44 PM, Kurt Hansen wrote:
   
 Would it be sufficient to add the following ssl parameters to my
 Rose::DB module? I realize I may
 need to do some work to configure DBD::mysql to support ssl connections,
 but if DBD::mysql configured properly, will Rose::DB send the parameters
 properly?

 __PACKAGE__-register_db(
   domain   = 'pax',
   type = 'transaction',
   driver   = 'mysql',
   database = 'dbname',
   host = '192.168.2.18',
   username = 'USERNAME',
   password = 'PASSWORD',

   #ssl parameters:
   mysql_ssl = 1,
   mysql_ssl_client_key = 'KEYFILE',
   mysql_ssl_client_cert = 'CERTFILE',
   mysql_ssl_ca_file = 'CAFILE',
   #end ssl parameters
  );
 

 Assuming those are connection options for DBD::mysql, try Rose::DB's
 connect_options method:

 http://search.cpan.org/dist/Rose-DB/lib/Rose/DB.pm#connect_options

  __PACKAGE__-register_db(
 ...
 connect_options =
 {
   mysql_ssl = 1,
   mysql_ssl_client_key = 'KEYFILE',
   mysql_ssl_client_cert = 'CERTFILE',
   mysql_ssl_ca_file = 'CAFILE',
 },
   );

 If those values need to be inlined into the DSN, then Rose::DB will need to
 be changed to support them.
   
Thanks, John, for your rapid response and advice. I'm able to do the 
remote connection over SSL now.

However, I did not try the connect_options method based on your 
inlined into the DSN comment and reading up on the Rose::DB and DBI 
docs. The SSL options DO need to be inlined into the DSN so I took a 
different tack. Essentially, I created a db handle using DBI, used the 
dbh method for my Rose::DB object to set the object'd dbh to the one I 
created, and then passed this Rose::DB object to by RDBO object when 
creating it.

Once I got my head around how Rose::DB and Rose::DB::Object interact, it 
was very simple to do this. Thanks!

For those who want to do this, here's what I had to do (including the  
mySQL and DBD steps):

1. Get a mySQL server and client binary that supports SSL. I first 
thought all needed to do was get a client that supports SSL, but it 
turns out you need to install the server binary along with the client 
binary to get the SSL support. Those wiser than I might be able to 
figure out how to compile a mySQL client binary from the sources, but 
the easiest path for me was to grab the latest stable mySQL binaries. 
That was 5.0.45 in my case. These have SSL capability built in. To 
enable the SSL in the server, you need to start with server with the ssl 
parameter set. See mySQL documentation for details.

2. Compile DBD::mysql with SSL support. See DBD::mysql docs for details. 
This is pretty straitforward.

3. Register the remote database in your Rose::DB object, e.g:

package My::RoseDB;
use strict;
use base 'Rose::DB';

# Use a private registry for this class
__PACKAGE__-use_private_registry;

# Set the default domain and type
__PACKAGE__-default_domain('domain');
__PACKAGE__-default_type('type');

# Register the data sources

__PACKAGE__-register_db(
  domain   = 'mirror',
  type = 'dbtype',
  driver   = 'mysql',
  database = 'databasename',
  host = '192.168.2.3',
  username = 'username',
  password = 'password',
);

1;

4. Create your connection to the database using DBI, assign that db 
handle to your Rose::DB object, use that Rose::DB object when creating 
your RDBO object:

use DBI;
use My::RoseDB;
use My::RDBO;

my $dsn = 
DBI:mysql:databasename;host=192.168.2.3;mysql_ssl=1;mysql_ssl_client_
key=KEYFILE;mysql_ssl_client_cert=CERTFILE;mysql_ssl_ca_file=CAFILE;
my $user = 'username';
my $password = 'password';
my $dbh = DBI-connect($dsn, $user, $password, {'RaiseError' = 
1}) or d
ie Can't connect to database: $DBI::errstr\n;
my $db = My::RoseDB-new(domain='mirror',type='transact');
$db-dbh($dbh);


foreach my $trans (@{$transactions}) {
my %data = $trans-hashify;
my %mirror_data = Convert::Utils-main_to_trans(hash = \%data);
print (\n mirror data: , Dumper(%mirror_data));
my $mirror = DB::CWTrans::Transaction-new(db= $db);




-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now   http://get.splunk.com/
___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


Re: [RDBO] Remote DB connection over SSL to MySQL DB using Rose::DB

2007-09-03 Thread Kurt Hansen
(Previous message sent before editting complete. Please ignore.)
John Siracusa wrote:
 On 8/26/07 11:44 PM, Kurt Hansen wrote:
   
 Would it be sufficient to add the following ssl parameters to my
 Rose::DB module? I realize I may
 need to do some work to configure DBD::mysql to support ssl connections,
 but if DBD::mysql configured properly, will Rose::DB send the parameters
 properly?

 __PACKAGE__-register_db(
   domain   = 'pax',
   type = 'transaction',
   driver   = 'mysql',
   database = 'dbname',
   host = '192.168.2.18',
   username = 'USERNAME',
   password = 'PASSWORD',

   #ssl parameters:
   mysql_ssl = 1,
   mysql_ssl_client_key = 'KEYFILE',
   mysql_ssl_client_cert = 'CERTFILE',
   mysql_ssl_ca_file = 'CAFILE',
   #end ssl parameters
  );
 

 Assuming those are connection options for DBD::mysql, try Rose::DB's
 connect_options method:

 http://search.cpan.org/dist/Rose-DB/lib/Rose/DB.pm#connect_options

  __PACKAGE__-register_db(
 ...
 connect_options =
 {
   mysql_ssl = 1,
   mysql_ssl_client_key = 'KEYFILE',
   mysql_ssl_client_cert = 'CERTFILE',
   mysql_ssl_ca_file = 'CAFILE',
 },
   );

 If those values need to be inlined into the DSN, then Rose::DB will need to
 be changed to support them.
   
Thanks, John, for your rapid response and advice. I'm able to do the
remote connection over SSL now.

However, I did not try the connect_options method based on your
inlined into the DSN comment and reading up on the Rose::DB and DBI
docs. The SSL options DO need to be inlined into the DSN so I took a
different tack. Essentially, I created a db handle using DBI, used the
dbh method for my Rose::DB object to set the object'd dbh to the one I
created, and then passed this Rose::DB object to by RDBO object when
creating it.

Once I got my head around how Rose::DB and Rose::DB::Object interact, it
was very simple to do this. Thanks!

For those who want to do this, here's what I had to do (including the
mySQL and DBD steps):

1. Get a mySQL server and client binary that supports SSL. I first
thought that all I needed to do was get a client that supports SSL, but
it turns out you need to install the server binary along with the client
binary to get the SSL support. Those wiser than I might be able to
figure out how to compile a mySQL client binary from the sources, but
the easiest path for me was to grab the latest stable mySQL binaries.
That was 5.0.45 in my case. These have SSL capability built in. To
enable the SSL in the server, you need to start the server with the ssl
parameter set. See mySQL documentation for details.

2. Compile DBD::mysql with SSL support. See DBD::mysql docs for details.
This is pretty straitforward.

3. Register the remote database in your Rose::DB object, e.g:

package My::RoseDB;
use strict;
use base 'Rose::DB';

# Use a private registry for this class
__PACKAGE__-use_private_registry;

# Set the default domain and type
__PACKAGE__-default_domain('domain');
__PACKAGE__-default_type('type');

# Register the data sources

__PACKAGE__-register_db(
  domain   = 'mirror',
  type = 'dbtype',
  driver   = 'mysql',
  database = 'databasename',
  host = '192.168.2.3',
  username = 'username',
  password = 'password',
);

1;

4. Create your connection to the database using DBI, assign that db
handle to your Rose::DB object, use that Rose::DB object when creating
your RDBO object:

use DBI;
use My::RoseDB;
use My::RDBO;

my $dsn =
DBI:mysql:databasename;host=192.168.2.3;mysql_ssl=1;mysql_ssl_client_key=KEYFILE;mysql_ssl_client_cert=CERTFILE;mysql_ssl_ca_file=CAFILE;

my $user = 'username';
my $password = 'password';
my $dbh = DBI-connect($dsn, $user, $password, {'RaiseError' = 
1}) or die Can't connect to database: $DBI::errstr\n;
my $db = My::RoseDB-new(domain='mirror',type='dbtype');
$db-dbh($dbh);

my $mirror =  My::RDBO-new(db= $db);

and away you go. :-)



Take care,

Kurt Hansen
[EMAIL PROTECTED]



-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now   http://get.splunk.com/
___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


Re: [RDBO] Remote DB connection over SSL to MySQL DB using Rose::DB

2007-09-03 Thread Kurt Hansen
John Siracusa wrote:
 On 9/3/07 12:31 PM, Kurt Hansen wrote:
   
 However, I did not try the connect_options method based on your
 inlined into the DSN comment and reading up on the Rose::DB and DBI
 docs. The SSL options DO need to be inlined into the DSN
 

 Okay, I'll make the change in SVN when I get a chance.

   
Thanks! You can probably prioritize this low since there is an easy 
workaround.

Take care,

Kurt

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now   http://get.splunk.com/
___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


[RDBO] Remote DB connection over SSL to MySQL DB using Rose::DB

2007-08-26 Thread Kurt Hansen
Hello,

I'm trying to connect to a remote MySQL database over an SSL connection.

I'm not sure if it is possible using Rose::DB. It looks like DBD::mysql 
does support it, so I'm guessing Rose::DB does.

Would it be sufficient to add the following ssl parameters to my 
Rose::DB module? I realize I may
need to do some work to configure DBD::mysql to support ssl connections, 
but if DBD::mysql configured properly, will Rose::DB send the parameters 
properly?

__PACKAGE__-register_db(
  domain   = 'pax',
  type = 'transaction',
  driver   = 'mysql',
  database = 'dbname',
  host = '192.168.2.18',
  username = 'USERNAME',
  password = 'PASSWORD',

  #ssl parameters:
  mysql_ssl = 1,
  mysql_ssl_client_key = 'KEYFILE',
  mysql_ssl_client_cert = 'CERTFILE',
  mysql_ssl_ca_file = 'CAFILE',
  #end ssl parameters

 );

Any advice much appreciated!

Thanks,

Kurt Hansen
[EMAIL PROTECTED]


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now   http://get.splunk.com/
___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


Re: [RDBO] Last call before 0.761

2007-02-21 Thread Kurt Hansen

Ask Bjørn Hansen wrote:

Note the  default to foo.

MySQL, correctly, says the default is NULL:

mysql show create table bars\G
*** 1. row ***
Table: bars
Create Table: CREATE TABLE `bars` (
   `id` int(10) unsigned NOT NULL,
   `foo` varchar(255) NOT NULL,
   PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1

mysql select * from information_schema.columns where table_schema =  
'ntppool' and table_name = 'bars' and column_name = 'foo'  \G
*** 1. row ***
TABLE_CATALOG: NULL
 TABLE_SCHEMA: ntppool
   TABLE_NAME: bars
  COLUMN_NAME: foo
 ORDINAL_POSITION: 2
   COLUMN_DEFAULT: NULL
  IS_NULLABLE: NO
DATA_TYPE: varchar
CHARACTER_MAXIMUM_LENGTH: 255
   CHARACTER_OCTET_LENGTH: 255
NUMERIC_PRECISION: NULL
NUMERIC_SCALE: NULL
   CHARACTER_SET_NAME: latin1
   COLLATION_NAME: latin1_swedish_ci
  COLUMN_TYPE: varchar(255)
   COLUMN_KEY:
EXTRA:
   PRIVILEGES: select,insert,update,references
   COLUMN_COMMENT:
1 row in set (0.03 sec)
  

There seems to be a contradiction in the create statement foo ... NOT 
NULL and the default expectation of NULL.

I'm surprised that mySQL specifies a default of NULL in this case.  
seems like a more reasonable response. So, is this a problem with mySQL 
or with your create statement or RDBO? (Speaking as a fan of mySQL since 
it's the only DB I've been using the past 7 years.)

Take care,

Kurt

-- 
Kurt Hansen
CharityWeb
[EMAIL PROTECTED]
866 4eTools (866 438-6657)

Our laws set us free. - Anon


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


[RDBO] Suppress (or FOREIGN KEY is NULL) in queries

2006-12-05 Thread Kurt Hansen
Hello,

I must be missing something. When Manager creates a JOIN, it adds a OR 
(tN.FK IS NULL) to the where clause even though FK is defined as 
not_null = 1 in tN. Adding this clause really extends the query time on 
some queries. I just tested one with and without the OR clause; with 
took 9 minutes while without took 30 seconds.

So, it's critical that I fix this but I don't know where to change 
QueryBuilder's behavior.

Here are the offending FROM and WHERE clauses:

FROM
  transactions t1
  LEFT OUTER JOIN persons t2 ON(t1.id = t2.transaction_id)
  LEFT OUTER JOIN customs t3 ON(t1.id = t3.transaction_id)
  LEFT OUTER JOIN donorccs t4 ON(t1.id = t4.transaction_id)
  LEFT OUTER JOIN baskets t5 ON(t1.id = t5.transaction_id)
WHERE
  t1.Result = 0 AND
  NOT(t5.Sustainer = 'Yes') AND
  ((t1.id = t2.transaction_id) OR (t2.transaction_id IS NULL)) AND
  ((t1.id = t3.transaction_id) OR (t3.transaction_id IS NULL)) AND
  ((t1.id = t4.transaction_id) OR (t4.transaction_id IS NULL)) AND
  ((t1.id = t5.transaction_id) OR (t5.transaction_id IS NULL))

RDBO version: 0.75
Database is MySQL 4.1
transaction_id is defined this way in each of the child tables:
transaction_id = { type = 'integer', default = '0', not_null = 1 },

Here is the query that was 10 times faster:

FROM
  transactions t1
  LEFT OUTER JOIN persons t2 ON(t1.id = t2.transaction_id)
  LEFT OUTER JOIN customs t3 ON(t1.id = t3.transaction_id)
  LEFT OUTER JOIN donorccs t4 ON(t1.id = t4.transaction_id)
  LEFT OUTER JOIN baskets t5 ON(t1.id = t5.transaction_id)
WHERE
  t1.Result = 0 AND
  NOT(t5.Sustainer = 'Yes') AND
  ((t1.id = t2.transaction_id) ) AND
  ((t1.id = t3.transaction_id) ) AND
  ((t1.id = t4.transaction_id) ) AND
  ((t1.id = t5.transaction_id) )

Thanks!

Kurt Hansen
[EMAIL PROTECTED]

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


Re: [RDBO] Best way to do sum, max, avg, group by

2006-09-01 Thread Kurt Hansen
Hi John,

John Siracusa wrote:
 On 8/30/06, Kurt Hansen [EMAIL PROTECTED] wrote:
 my($sql, $bind) = $class-get_products_sql(%args);
 Shouldn't this be:

 my($sql, $bind) = $class-get_objects_sql(%args);
 
 Whoops, yeah, and you'll have to pass an object_class = ... parameter
 in %args unless you've overridden object_class() (although there's a
 bug regarding that bit, fixed in SVN, but for now best to just add
 object_class = ... to %args)
 
 However, using this code gives me the following error:

 Can't call method meta on an undefined value at
 /usr/local/lib/perl5/site_perl/5.8.5/Rose/DB/Object/Manager.pm line 325.

 line 325 is this:

 my $meta = $object_class-meta;

 in the get_objects method.
 
 Looks like you found that bug I just mentioned :)  Just add
 object_class = 'My::Product' (or whatever) to %args.

Thanks! Yes, I had figured that out and added

$args{'object_class'} = 'My::Product';

(sticking with your nomenclature) and moved on to the next bug...

Now, I'm having problems with the

$args{'select'} = $args{'group_by'}, AVG(prices) ;

line. The sql that is being produced is:

SELECT t2.type, t1.AVG{prices) 

so throws an error. The sql should be:

SELECT t2.type, AVG(t1.prices) 

I've been looking through the docs trying to figure out how to properly 
specify AVG(COLUMN) in the 'select' argument with no success. Is it 
possible?

Take care,

Kurt



-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


Re: [RDBO] Best way to do sum, max, avg, group by

2006-09-01 Thread Kurt Hansen

 moving on to the next bug...
 
 Now, I'm having problems with the
 
 $args{'select'} = $args{'group_by'}, AVG(prices) ;
 
 line. The sql that is being produced is:
 
 SELECT t2.type, t1.AVG{prices) 
 
 so throws an error. The sql should be:
 
 SELECT t2.type, AVG(t1.prices) 
 
 I've been looking through the docs trying to figure out how to properly 
 specify AVG(COLUMN) in the 'select' argument with no success. Is it 
 possible?

It just occurred to me that I could just to a regex on the sql statement 
and fix the SELECT portion. I'm going to try that out.

Take care,

Kurt

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


[RDBO] Best way to do sum, max, avg, group by

2006-08-30 Thread Kurt Hansen
Hello,

I need to do sum, max, avg, group by on columns in my database. However, 
I'm not sure the best way to do it in RDBO. The count() method in 
Manager makes me think that there may be some pre-existing methods to do 
these tasks.

If not, is it best to create a method using QueryBuilder and Manager? 
I'm guessing it would be something analogous to count(). Where can I 
look to find an example of how the count method is built and integrated 
into Manager?

Thanks!

Kurt Hansen
[EMAIL PROTECTED]

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


Re: [RDBO] Best way to do sum, max, avg, group by

2006-08-30 Thread Kurt Hansen

John Siracusa wrote:
 On 8/30/06, Kurt Hansen [EMAIL PROTECTED] wrote:
 I need to do sum, max, avg, group by on columns in my database. However,
 I'm not sure the best way to do it in RDBO. The count() method in
 Manager makes me think that there may be some pre-existing methods to do
 these tasks.

 If not, is it best to create a method using QueryBuilder and Manager?
 I'm guessing it would be something analogous to count(). Where can I
 look to find an example of how the count method is built and integrated
 into Manager?
 
 The get_objects_count() method exists because it's a well-known,
 well-defined operation: tell me how many objects (from the primary
 table) would have been fetched had I called get_objects().
 
 The get_objects() method always...

...much very helpful information snipped ...

Thank you VERY much, John! That's a huge help! You've answered my 
questions, including ones I didn't know I had. :-)

Take care,

Kurt

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


[RDBO] DBIx::Class or Rose::DB::Object or other???

2006-06-06 Thread Kurt Hansen
Hello,

Last summer, I started developing new applications using Class::DBI 
rather than my own home grown DBI modules.

A few weeks ago, I saw a reference on the mod_perl list to the benchmark 
page:
http://rose.sourceforge.net/wiki/index.php/RDBO/Benchmark

Rather than sticking with Class::DBI, I am looking to switch to 
Rose::DB::Object or DBIx::Class or (maybe there is some other out 
there??). I'm trying to understand what the differences are and which 
are relevant for my environment. So far, this is what I've picked up 
(yes a bit slim):

1. RDBO is faster.
2. DBIC has a Class::DBI compatibility layer that will make the 
transition from CDBI easier

Any other key things I should note? Also, will the speed advantage of 
RDBO be maintained, or are both such young modules that it's hard to say 
where the speed advantage will end up?

I develop using HTML::Mason in a mod_perl environment. My db management 
system is MySQL, and the databases being developed are normalized with 
multiple foreign keys.

I figure that if I had asked this question a year ago on the CDBI list, 
I probably would be ahead of the game now with either RDBO or DBIC. ;-)

I'll do my best to summarize the responses and put them on both lists 
for future reference; I'm sure it is a question others have.

Thanks for your attention.

Take care,

Kurt Hansen
[EMAIL PROTECTED]


___
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object