in reply to Re: [meditation] Structured, Typed Program Catalogs
in thread [meditation] Structured, Typed Program Catalogs

While it's common to externalize end-user visible text, it's a little less common to externalize SQL. But if your application is well structured, SQL should be limited to a set of readily identifiable modules.
But then how do you answer the type of questions I mentioned? Ie, what types of queries, what tables are they querying. Also, when you have > 1000 queries (and queries can be quite large), they take up memory space and should be externalized. I list all the motivations for SQL::Catalog in its docs. Kind of in a hurry now...

Carter's compass: I know I'm on the right track when by deleting something, I'm adding functionality

  • Comment on Re: Re: [meditation] Structured, Typed Program Catalogs

Replies are listed 'Best First'.
Re: Re: Re: [meditation] Structured, Typed Program Catalogs
by shotgunefx (Parson) on Nov 18, 2002 at 22:21 UTC
    I like to keep it simple. Personally, for me I usually store all of my SQL in a seperate module for easy swapping.
    If I had a 1000 queries, I would probably use a tied BerkeleyDB hash instead to cut down on load time, etc.
    If I had to figure out what was doing what, I would probably write an SQL parser, (probably building off of SQL::Statement or similar) running it on all the queries in the module and verifying the unparsable ones by hand.

    -Lee

    "To be civilized is to deny one's nature."