Re: [GENERAL] Efficiency vs. code bloat for SELECT wrappers

2007-12-18 Thread Colin Wetherbee
Colin Wetherbee wrote: My guess, having written this, is that your approach might be more useful for applications that rely heavily on interaction with a database. I'd appreciate any more comments you have on this, though. Tom, Sam, and Ted (a lovely assortment of three-letter names), thank

Re: [GENERAL] Efficiency vs. code bloat for SELECT wrappers

2007-12-17 Thread Colin Wetherbee
Sam Mason wrote: On Sun, Dec 16, 2007 at 06:31:56PM -0500, Colin Wetherbee wrote: If I write one Perl sub for each operation on the table (e.g. one that gets the username and password hash, another that gets the last name and first name, etc.), there will be a whole lot of subs, each of which

Re: [GENERAL] Efficiency vs. code bloat for SELECT wrappers

2007-12-17 Thread Sam Mason
On Mon, Dec 17, 2007 at 12:49:46PM -0500, Colin Wetherbee wrote: Because I know Perl a whole lot better than SQL, PostgreSQL, and even the Perl DBI, I'm always inclined to wrap the database stuff in a nice little package and forget about it. This method has worked well for me in the past,

Re: [GENERAL] Efficiency vs. code bloat for SELECT wrappers

2007-12-17 Thread Ted Byers
--- Colin Wetherbee [EMAIL PROTECTED] wrote: Sam Mason wrote: On Sun, Dec 16, 2007 at 06:31:56PM -0500, Colin Wetherbee wrote: If I write one Perl sub for each operation on the table (e.g. one that gets the username and password hash, another that gets the last name and first name,

Re: [GENERAL] Efficiency vs. code bloat for SELECT wrappers

2007-12-17 Thread Colin Wetherbee
Sam Mason wrote: Luckily I've been able to design most of the programs I work on as relatively simple layers over a database, I'm not sure if you're able to work like this. I'm not at liberty to divulge much of the application concept, but consider, if you will, an application like Gmail or

Re: [GENERAL] Efficiency vs. code bloat for SELECT wrappers

2007-12-17 Thread Colin Wetherbee
Ted Byers wrote: --- Colin Wetherbee [EMAIL PROTECTED] wrote: Sam Mason wrote: On Sun, Dec 16, 2007 at 06:31:56PM -0500, Colin Wetherbee wrote: If I write one Perl sub for each operation on the table (e.g. one that gets the username and password hash, another that gets the last name and

Re: [GENERAL] Efficiency vs. code bloat for SELECT wrappers

2007-12-17 Thread Sam Mason
On Mon, Dec 17, 2007 at 01:29:10PM -0500, Ted Byers wrote: I routinely keep my SQL code distinct from my Perl, java or C++ code. When a client program needs to do something with the database, then either a child process executes a script I have written, if the client program doesn't need to

Re: [GENERAL] Efficiency vs. code bloat for SELECT wrappers

2007-12-17 Thread Ted Byers
--- Sam Mason [EMAIL PROTECTED] wrote: On Mon, Dec 17, 2007 at 01:29:10PM -0500, Ted Byers wrote: I routinely keep my SQL code distinct from my Perl, java or C++ code. When a client program needs to do something with the database, then either a child process executes a script I have

[GENERAL] Efficiency vs. code bloat for SELECT wrappers

2007-12-16 Thread Colin Wetherbee
Greetings. I am working on a PostgreSQL-backed mod_perl web application that's just in its infancy. Let's say I have a users table that holds about 15 columns of data about each user. If I write one Perl sub for each operation on the table (e.g. one that gets the username and password

Re: [GENERAL] Efficiency vs. code bloat for SELECT wrappers

2007-12-16 Thread Tom Lane
Colin Wetherbee [EMAIL PROTECTED] writes: Let's say I have a users table that holds about 15 columns of data about each user. If I write one Perl sub for each operation on the table (e.g. one that gets the username and password hash, another that gets the last name and first name, etc.),

Re: [GENERAL] Efficiency vs. code bloat for SELECT wrappers

2007-12-16 Thread Colin Wetherbee
Tom Lane wrote: Colin Wetherbee [EMAIL PROTECTED] writes: Let's say I have a users table that holds about 15 columns of data about each user. If I write one Perl sub for each operation on the table (e.g. one that gets the username and password hash, another that gets the last name and first