Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Topics in Perl Programming: Table-Mutation Tolerant Database Fetches with DBI

by quidity (Pilgrim)
on Nov 29, 2000 at 00:20 UTC ( [id://43760]=note: print w/replies, xml ) Need Help??


in reply to Topics in Perl Programming: Table-Mutation Tolerant Database Fetches with DBI

If you expect to have to access a database with colums that change then it's time for you to embrace a buzzword or two.

Essentially you need to tuck away all the bits of your code which actually talk to the database. Make a module with an OO interface, ensure that remains constant in time, then any changes in the database structure (or even the method of actually storing the data) become moot.

Then to get at some data all you'd need to do is:

@values = $abstracted_db->beans_with_colour('red');

Now, doing that might take a bit of thought, but in the end it will pay off. The main drawback is that it slows you down a bit, but when you talk to databases, you're going to be fairly slow anyway.

  • Comment on Re: Topics in Perl Programming: Table-Mutation Tolerant Database Fetches with DBI
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://43760]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2025-05-24 21:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.