Re: looks like one database from the outside, but it's two inside



On Wed, Jul 18, 2007 at 10:23:52PM -0700, Theron Stanford wrote:
Overview: I'm trying to create the situation in the subject line:
from the outside, the database handle thinks it's just one database,
but inside it's really two databases containing tables with the same
schema but not necessarily the same data.

It's not really clear what you're trying to do. From what you say below
it seems that you just want to "just change the env var to switch
between servers". That's relatively simple but doesn't seem to match
what you said above.

My thoughts have turned to something like DBD::Proxy, because then I
could just change the environment variable DBI_PROXY when needed to
switch between servers.

Perhaps you could just use the DBI_AUTOPROXY env var to force a
different DSN without using DBD::Proxy.

I have also thought about writing a driver from scratch, using
SQL::Statement to help out, but that breaks the first rule of driver
writing ("Don't!"), and since this is for my job, the second rule
("Don't -- get someone else to do it for you!") isn't really an
option.

I'm not afraid of putting in the time to do this right, and I'm not
trying to get something for free. But I'd like some opinions about
what might be the correct approaches to this problem, especially if
there's something obvious that I've overlooked. (So OK, I'm trying to
get some advice for free :)

DBD::Multiplex may be worth exploring. (I have a modified and more
flexible version I worked on a couple of years ago that never quite got
polished up and released. It should probably be renamed as it's
slightly incompatible with the old one. Volunteers welcome.)

Tim.

.



Relevant Pages

  • Re: looks like one database from the outside, but its two inside
    ... Dumb, dumb, dumb (and ... database determine how my software interacts. ... have more than one "test" database, having a switch would really help. ... > switch between servers. ...
    (perl.dbi.users)
  • Re: Change Text to Memo
    ... Sorry I didn't initially mention that the database is elsewhere. ... Switch a given table field to Memo ... Function SwitchFieldType(sDb As String, sTableName As String, sFieldName ... Dim sSQL As String ...
    (microsoft.public.access.modulesdaovba)
  • Re: same old "Data has been changed error message", way around this?
    ... form, closing the database, finding or moving to another record, setting the ... Im searching for records, viewing results in a listbox, ... -Wants to run a report of only SOME of the matching records, ... Ideally I would just switch this ...
    (microsoft.public.access.formscoding)
  • Re: Switch statement alternative?
    ... replace those tokens instead of generic blanks. ... I do a switch on the part id. ... can you not use a struct or some other ADT to set ... If you need to store the part info between program runs, a file or database ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Detecting Rogues from the wired side
    ... If you can get mac addresses from CAM table on the client switches (snmp ... Think about scenario where someone first plug the small switch and then ... Something which collects all these MAC's or internal database + ... Download FREE whitepaper on how a managed service can ...
    (Pen-Test)