On Tue, 28 Feb 2006 22:44:48 -0500, John Siracusa wrote:

Hi John

> On 2/28/06 9:37 PM, Ron Savage wrote:
>> The only call to primary_key_info I found is in
>> Rose::DB::Object::Metadata::Auto, which will presumably just
>> work, since it ultimately calls $db->schema, and the new docs
>> will have told the user to set schema appropriately for Oracle,
>> right?
>>
>
> I really don't want setting the schema to be the common case just
> for its side-effects.  If username and schema really are the same
> thing, then in the places where a schema/username arg are required,
> how about using schema if set, or username otherwise?
>
> IOW, don't make schema default to username just to make
> primary_key_info() work.  Instead, before the call to
> primary_key_info(), get "schema if set, otherwise username" and use
> that value.  Repeat for each API that needs hand-holding.

I think you're tying yourself into knots here, trying to avoid something, i.e.
trying to be /too/ generic.

I would not want code inside Rose to say the schema param to primary_key_info
(or any method, actually) comes from $self -> schema || $self -> username. What
about another vendor where it has to be undef, and schema is undef, and username
is set, as usually it would have to be. Then username gets passed, wrongly.

The solution is obvious, use $self -> schema to pass the schema (i.e. the
Principle of Least Surprise), and tell Oracle users to set schema to uc $user.

No point in creating gotchas for non-Oracle users.

>> Anyway, if schema is unset, how could it return table names for
>> other users?
>>
> I thought you said that list_tables() with an undef or % schema arg
> listed all tables?  Does it just list tables owned by the connected
> user?

Just tables owned by the connected user. My test with 2 registry entries (2
users) returned just the tables which the 'current' user owned.

>> Anyway, do other db drivers have to worry about this possibility?
>>
> The only other supported db driver that uses schema is Pg, and it
> has totally separate concepts of schema and username.

Understood.

>> Anyway, I vote not to worry about this situation until we receive
>> a bug report with a corresponding patch :-)).
>>
>
> Better now than later, when a bug "fix" might break things from the

OK. Let's keep at it.

> perspective of current users.  Anyway, I think once we move into
> RDBO land, the test suite will help us make Oracle behave as much
> like the existing drivers as possible.

Does not compute. I'm running the test suite under Oracle while discussing all
this :-).
--
Ron Savage
[EMAIL PROTECTED]
http://savage.net.au/index.html




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to