[ANNOUNCE] DBIx::Cookbook - executable code samples for DBI(-based ORMs)?

2010-05-17 Thread Terrence Brannon
DBIx::Cookbook (http://search.cpan.org/dist/DBIx-Cookbook/) is an extensible collection of modular command-line scripts exemplifying the use of DBI and DBI-based ORMs. Based on the populated, normalized and documented data model (the MySQL Sakila database), the Cookbook provides fully-working

[ANN] DBIx::DBH - Perl extension for simplifying database connections

2005-03-23 Thread Terrence Brannon
named valid_params, and then have connect_data call that method and pass the return value to validate?) AUTHOR Terrence Brannon, [EMAIL PROTECTED] Sybase support contributed by Rachel Richard. Substantial suggestions by M. Simon Ryan Cavaletto. COPYRIGHT

Re: DBIx::DBH - Perl extension for simplifying database connectio ns

2004-12-17 Thread Terrence Brannon
Christopher Hicks [EMAIL PROTECTED] writes: Personally I'd like to see a solution based on AppConfig. We have our database configs in AppConfig. The config files look something like: I did that two years ago: http://search.cpan.org/author/TBONE/DBIx-Connect-1.13/lib/DBIx/Connect.pm

Re: DBIx::DBH - Perl extension for simplifying database connections

2004-12-01 Thread Terrence Brannon
/lib/HTTP/Request/Common.pm POST 'http://www.perl.org/survey.cgi', [ name = 'Gisle Aas', email = '[EMAIL PROTECTED]', gender = 'M', born = '1964', perc = '3%', ]; /quote -- Terrence Brannon, [EMAIL PROTECTED]

Re: DBIx::DBH - Perl extension for simplifying database connections

2004-11-30 Thread Terrence Brannon
Tim Bunce wrote: On Tue, Nov 30, 2004 at 07:21:11AM -0800, Terrence Brannon wrote: I don't get it. Can someone give me some small but real examples of the problem that's being solved here? well the ABSTRACT says it all... I regurgitate: quote DBIx::DBH is designed to facilitate and validate

DBIx::DBH - Perl extension for simplifying database connections

2004-11-29 Thread Terrence Brannon
a list of the 4 arguments required by the DBI connect() function. This is useful for working with modules that have an alternative connection syntax such as DBIx::AnyDBD or Alzabo. AUTHOR Terrence Brannon, [EMAIL PROTECTED] Acknowledgements This module is a refactoring of Alzabo

Re: SQL::Interpolate - request for comments

2004-01-03 Thread Terrence Brannon
Jim Cromie wrote: My comment was based on a cursory read, and general queasyness with non-placeholder construction of complex SQL - seeing all those $,@ just made me itch. let me make sure I understand the source of your quasiness: it is because if you use placeholders in conjunction with

Re: SQL::Interpolate - request for comments

2004-01-01 Thread Terrence Brannon
David Manura wrote: Terrence Brannon wrote: isnt that a long word to type every time? I envision subroutines with an interpolating property: sub get_authors : dbi_interp { my ($author_list) = @_; qq[SELECT * FROM AUTHORS WHERE author_id IN ], $author_list ; } my $sql = get_authors

Config::DBI - database connection support via Config::ApacheFormat files

2004-01-01 Thread Terrence Brannon
Ima:DBI is part of the tech stack Perl's most popular Perl database wrapper, Class::DBI. It does connection and SQL warehousing via Perl. DBIx::Connect The first module I wrote to address what I could not address under the auspices of DBIx::Password. AUTHOR Terrence Brannon, [EMAIL

Re: declarative DBI programming

2003-12-31 Thread Terrence Brannon
Aaron J.Mackey wrote: All I want to do with DBIx::Declare is provide a mechanism to separate the SQL into a separate file than the templates, so that the template designer only has to write: html pHello b#person.name#/b /html And the (now reusable) SQL as: name: person_name_by_id provides:

[ANNOUNCE] DBIx::Recordset 0.25 now on CPAN

2003-12-30 Thread Terrence Brannon
NEW FUNCTIONALITY (Cameron Prince, Terrence Brannon) * Full SQL Query input via the !Query option to Search() * added the '$makesql' flag to Search() so that generated SQL can be returned instead of executed. It will remain undocumented until it is supported for Update(), Delete(), and Insert

Re: SQL::Interpolate - request for comments

2003-12-30 Thread Terrence Brannon
David Manura wrote: Details are given below on a simple Perl module I wrote called SQL::Interpolate. I'm interested if others find this useful, find it redundant to existing modules, or have better ideas for designing it, as I'm considering submitting it to CPAN. (And if this is not the

Re: DBIx::Recordset updates dying with ambiguous column errors

2003-12-23 Thread Terrence Brannon
Joshua Gerrish wrote: I'm not sure if this is the right place to ask about DBIx::Recordset, my apologies if it isn't. The original author of DBIx::Recordset hangs out on his HTML::Embperl list and answers questions there: http://perl.apache.org/embperl/pod/doc/Embperl.-page-12-.htm The

DBI docs volunteer offer

2003-11-17 Thread Terrence Brannon
Currently the DBI database and statement handle methods are documented using =over 4 =item But I would like to rework the 1.38 docs so that =head3 tags are used. This will make the table of contents much more useful for drilling down to a particular method.

flattening selectall_hashref results + FetchHashAsRowKey

2003-11-15 Thread Terrence Brannon
Is there anyway to flatten the results of selectall_hashref ? Here is what I had to do in my sub: sub clans { my $clan_list = $dbh-selectall_hashref($SQL, 'id'); # the flattening that I was hoping DBI could do somehow :) my @ret; for my $id (sort keys %$clan_list) { push @ret,

Re: DBIx::Recordset struggles to pass tests

2003-11-12 Thread Terrence Brannon
Michael Gray wrote: source databases available, or I would do some testing and patching myself. There's no free version of Oracle for Windows is there? I run Cygwin. Hmm, I wonder what could be causing this to happen. I have only open Jeff's pointed out the free version. This morning,

Re: DBIx::Recordset struggles to pass tests

2003-11-11 Thread Terrence Brannon
Michael Gray wrote: Hs anyone had any luck getting DBIx::Recordset to pass its tests using recent versions of perl, DBI and DBD::Oracle? Angus Lees and myself have several patches for Recordset, most are archived in the embperl mailing list. Gerald was supposed to have a subversion

Re: what about named placeholders ?

2003-10-21 Thread Terrence Brannon
Jim Cromie wrote: I wanted to ask for named-placeholders in DBI, so that all DBD_*s could get them for free. But since a half baked patch is better than a half-assed question, Ive included one.(of each. ;-) DBIx::Librarian works this way. You might look at it as prior work if nothing else

Re: DBI installation problem on cygwin

2003-10-13 Thread Terrence Brannon
Fan Zheng wrote: Hi, I got Error makefile 1031: Redefinition of target 'Perl.c' error message when I issue 'make' command during DBI installation process on cygwin. Can any I am using the latest Cygwin and had no problems installing the latest DBI. Of course, the big question is: what does

What about DBIx::AnyDBD support in DBI?

2002-05-04 Thread Terrence Brannon
Is this on the TODO list anywhere? I presume it is after the lengthy list of items recently posted? I will continue to use DBIx::AnyDBD for the time being.

DBD::Pg and Postgresql with SSL extensions (fix)

2002-05-01 Thread Terrence Brannon
---BeginMessage--- Hi there, On Mittwoch, Mai 1, 2002, at 11:15 Uhr, Terrence Brannon wrote: Hi Marc, I was wondering what the proper way to de-install the postgresql package on your entropy.ch website was? The SSL support is causing problems at link time when the Perl DBI Postgresql

debugging a DBD::Pg connection (psql and telnet)

2002-05-01 Thread Terrence Brannon
I started postmaster via: ./bin/postmaster -D data -p 7000 but why does a telnet localhost 7000 result in a refused connection even though ./bin/psql -p 7000 test postgres works? Connecting via DBD::Pg is failing (with a Connection Refused error --- same thing I get when trying

DBD::Pg on Mac OS X - dyld errors

2002-04-30 Thread Terrence Brannon
Hi, I am running Mac OS X 10.1.3 and perl-5.7.2. I have my POSTGRES_LIB variable set correctly: setenv PG /usr/local/pgsql setenv POSTGRES_INCLUDE $PG/include setenv POSTGRES_LIB $PG/lib but I am getting errors at the make test phase of compilation:

DBD::Pg on Mac OS X - dyld errors

2002-04-30 Thread Terrence Brannon
Hi, I am running Mac OS X 10.1.3 and perl-5.7.3. I have my POSTGRES_LIB variable set correctly: setenv PG /usr/local/pgsql setenv POSTGRES_INCLUDE $PG/include setenv POSTGRES_LIB $PG/lib but I am getting errors at the make test phase of

Re: DBI, DBD::ODBC - password hiding method

2002-04-13 Thread Terrence Brannon
The two CPAN modules oriented towards password security are: DBIx::Password (by Brian Aker) DBIx::Connect(by me!) Your approach is most similar to DBIx::Password, but the weaknesses of this approach are discussed in the docs of DBIx::Connect Stacy Mader writes: : I put my

[ANNOUNCE] DBIx::Connect

2002-03-25 Thread Terrence Brannon
for database connection for EZDBI::EZCON: ftp://pthbb.org/pub/software/perl/EZDBI-EZCON-0.02/ hacker lang=Perl type=just another url=http://www.metaperl.com; Terrence Brannon /hacker

Re: recordset

2002-03-12 Thread Terrence Brannon
On Wednesday, March 6, 2002, at 04:51 PM, Vorce, Tim (T.) wrote: I am interested in the module DBIx::Recordset, however, putting good choice! use DBIx::Recordset; at the top of my script, an error occurs, as the module cannot be located. the precise error text is always a good thing

SQL Relay - pooling proxying load balancing for Perl / DBI and other platforms

2002-03-02 Thread Terrence Brannon
database-driven web-based applications, accessing databases from unsupported platforms, migrating between databases, distributing access to replicated databases and throttling database access /quote hacker lang=Perl type=just another url=http://wwwmetaperlcom; Terrence Brannon /hacker

AppConfig::DBI - AppConfig-based support for DBI connection and connection data

2002-03-02 Thread Terrence Brannon
[ this is pre-CPAN until Monday ] AppConfig-DBI-0.01.tar.gz Description: GNU Zip compressed data NAME AppConfig::DBI - AppConfig-based support for DBI connection and connection data SYNOPSIS # .cshrc setenv APPCONFIG /Users/metaperl/.appconfig # dont forget the

Re: arbitrary number of bindings LIKE statement

2002-01-24 Thread Terrence Brannon
On Wednesday, January 16, 2002, at 02:13 PM, Michael A Chase wrote: You need to start a little earlier. Build the SQL so it has the desired number of placeholders. or visit CPAN to find a searchbuilder in the DBIx or SQL hiearchies. # The default error message is more thorough that

Re: Maintaining a Cache of Hash References

2002-01-15 Thread Terrence Brannon
On Tuesday, January 15, 2002, at 04:25 PM, Tomasi, Chuck wrote: I'm trying to maintain a cache of hashes to reduce database hits. What I my CPAN module DBIx::Cache may fill the bill... but Memoize sounds good too.

can someone explain/exemplify DBD::Multiplex?

2002-01-12 Thread Terrence Brannon
It appears that this module does not have docs and I have no idea what is useful for, but would appreciate some pointers... Thanks.

Re: Column names and etc..

2002-01-11 Thread Terrence Brannon
On Friday, January 11, 2002, at 07:09 AM, Bart Lateur wrote: [beginners list snipped] On Fri, 11 Jan 2002 11:40:03 +0100, Marius Keraitis wrote: Second step is to show every table contents (by clicking on link with table name). To do this I need to know how many columns is in table,

Re: DBI module

2002-01-09 Thread Terrence Brannon
On Tuesday, January 8, 2002, at 09:27 PM, John Tankersley wrote: Hello, My name is John Tankersley. I am seeking some help with the perl modules. I hope I understand the dbi modules. Please correct me if I am wrong.I am building databases using mysql. Have you considered postgresql? It is

Re: (Fwd) Important: Subclassing and Merging DBIx::AnyDBD into the DBI

2002-01-08 Thread Terrence Brannon
On Monday, January 7, 2002, at 08:29 AM, Tim Bunce wrote: Seems like you're creating a whole bunch of duplicate code with little reuse. It would seem better to create a module that implements the concept in a more generic way. Perhaps something like: use AutoObject class = DBI::db,

Re: Binding input parameters in DB2

2002-01-08 Thread Terrence Brannon
On Monday, January 7, 2002, at 10:54 PM, s1ider wrote: What am I doing wrong? I have followed the perldoc DBD::DB2 and even [Fri Jan 6 22:58:11 2002] [error] Can't call method prepare on an undefined value at /usr/perl/cgi/permit_organization.cgi line 74. where is line 74?

Re: Important: Subclassing and Merging DBIx::AnyDBD into the DBI

2002-01-07 Thread Terrence Brannon
On Friday, January 4, 2002, at 07:40 PM, Tim Bunce wrote: Anyone not very comfortable with assigning to @ISA should not be trying to subclass the DBI! But having said that, it certainly could be made easier... My experience is that an application needing extended database functionality

Re: mapping NULL values

2002-01-07 Thread Terrence Brannon
On Friday, January 4, 2002, at 10:51 AM, Mitch Helle-Morrissey wrote: why not use a NVL in your select staetment? The problem is that my selects are dynamic so I have no idea what types the columns are. It is rare that SELECT statements are as dynamic as people claim. You could create a

Re: invoking insert method inside a transaction eval

2002-01-07 Thread Terrence Brannon
On Monday, January 7, 2002, at 08:17 AM, Tim Bunce wrote: Umm, these days you'd use $dbh-begin_work, right? I didn't see this in my version of DBI, which I thought was 1.20 but indeed it is documented in the docs on CPAN. The documented behavior is the same as the methods in DBIx.pm

Re: invoking insert method inside a transaction eval

2002-01-07 Thread Terrence Brannon
On Monday, January 7, 2002, at 08:17 AM, Tim Bunce wrote: Umm, these days you'd use $dbh-begin_work, right? that's funny. that method is not in my docs on my home machine, but it certainly is on the docs at CPAN... i had not seen it before. the only thing that the transaction methods do

Re: invoking insert method inside a transaction eval

2002-01-07 Thread Terrence Brannon
On Monday, January 7, 2002, at 08:17 AM, Tim Bunce wrote: Umm, these days you'd use $dbh-begin_work, right? that's funny. that method is not in my docs on my home machine, but it certainly is on the docs at CPAN... i had not seen it before. the extra things that the transaction methods

Re: darwin/os x, DBI, DBD::Pg.

2001-12-19 Thread Terrence Brannon
On Wednesday, December 19, 2001, at 10:12 AM, Sean wrote: /usr/bin/ld: table of contents for archive: /usr/local/pgsql/lib/libpq.a is out of date; rerun ranlib(1) (can't load from it) make: *** [blib/arch/auto/DBD/Pg/Pg.bundle] Error 1 [localhost:~/Desktop/DBD-Pg-1.01] sean% No solution

Re: Problem interfacing with Postgresql

2001-12-17 Thread Terrence Brannon
On Saturday, December 15, 2001, at 03:04 PM, Tom Perdue wrote: I am trying to access my database with db_browser but keep getting the following error: DBD::Pg initialization failed: Can't locate object method driver via package DBD::Pg (Perhaps you forgot to load DBD::Pg?) at

Re: Suggested new module -- DBI::Wrapper or DBIx::Wrapper

2001-12-11 Thread Terrence Brannon
On Monday, December 10, 2001, at 11:45 PM, Matisse Enzer wrote: Hi folks. Hi Matisse. I'm looking for feedback on this... You would write: my $sql = SELECT name,address FROM $table WHERE zipcode=?; my $found_rows = $wrapper-FetchAll($sql,$zipcode); # $found_rows is an

Re: SQL::Statement cannot parse valid Postgresql statement

2001-12-10 Thread Terrence Brannon
On Monday, December 10, 2001, at 09:16 AM, Jeff Zucker wrote: Terrence Brannon wrote: The following SQL is not parseable by SQL::Statement: INSERT INTO thot_log (thot_fk,thot_type_fk,thot_temporality_fk,date) VALUES (?,?,?,CURRENT_TIMESTAMP) the error msg is : Parse error

Re: SQL::Statement cannot parse valid Postgresql statement

2001-12-10 Thread Terrence Brannon
On Monday, December 10, 2001, at 10:30 AM, Wilson, Doug wrote: From: Terrence Brannon [mailto:[EMAIL PROTECTED]] On Monday, December 10, 2001, at 09:16 AM, Jeff Zucker wrote: Terrence Brannon wrote: The following SQL is not parseable by SQL::Statement: INSERT INTO thot_log

Re: SQL::Statement cannot parse valid Postgresql statement

2001-12-10 Thread Terrence Brannon
On Monday, December 10, 2001, at 11:29 AM, Jeff Zucker wrote: It's still not clear to me exactly what you're expecting SQL::Statment to do, but if it's a simple as identifying the command, my newer version (still in development) can allow you to bypass the error message you're getting

SQL::Statement cannot parse valid Postgresql statement

2001-12-09 Thread Terrence Brannon
The following SQL is not parseable by SQL::Statement: INSERT INTO thot_log (thot_fk,thot_type_fk,thot_temporality_fk,date) VALUES (?,?,?,CURRENT_TIMESTAMP) the error msg is : Parse error near CURRENT_TIMESTAMP) Also, this module is listed under Jochen Wiedman, but I was under the

Re: ANNOUNCE: DBIx::Librarian 0.1

2001-11-15 Thread Terrence Brannon
On Wednesday, November 14, 2001, at 10:33 PM, Jason W May wrote:     The implementation provided by DBIx::Librarian is sufficiently     different from other related modules (in particular, SQL::Catalog)     that this module is not rehashing previously-explored territory. The example you

Re: Quoting with placeholders

2001-11-02 Thread Terrence Brannon
On Friday, November 2, 2001, at 06:30 PM, Stacy Mader wrote: Thanks for that Jeff. Now that I have: $dbh-do(INSERT INTO $fault_db VALUES (?,?,?,?,?,?,?,?,?,?,?,?) , undef, $fault_no, $reported_by, $project_no, undef, $date_occurred,

Re: dbi:Pg slowness

2001-10-31 Thread Terrence Brannon
On Wednesday, October 31, 2001, at 04:41 PM, Alex Pilosov wrote: First thing that comes to mind: a) do you have an index on tqosinsp_rwd? b) did you vacuum the table in question? 6000 transactions per hour seems awfully slow. Doesnt it depend on whether the transactions are insert,

Re: Batch Fetching - Out of memory Error

2001-10-29 Thread Terrence Brannon
fetch on table 5 } Each query is depended on the value from the value of the first fetch. Sumera -- From:Terrence Brannon[SMTP:[EMAIL PROTECTED]] Sent:Monday, October 29, 2001 2:09 PM To: [EMAIL PROTECTED] Subject: Re: Batch Fetching

why is the DBI namespace reserved?

2001-10-28 Thread Terrence Brannon
I know of no other package which attempts to reserve a top-level namespace for itself. In fact, CPAN strongly advises aginst this practice. Compare with CGI, another module of equally wide use. I am aware of no attempt my Lincoln Stein to reserve CGI::* for modules developed for specific use

ANN: SQL::Catalog - test, label, store, search and retrieve SQL queries

2001-10-25 Thread Terrence Brannon
The URL http://princepawn.perlmonk.org/domains/semantic- elements.com/cpan/SQL-Catalog-0.01.tar.gz has entered CPAN as file: $CPAN/authors/id/T/TB/TBONE/SQL-Catalog-0.01.tar.gz NAME SQL::Catalog - test, label, store, search and retrieve SQL queries SYNOPSIS shell% cd

my execute is not failing when placeholder values are not supplied

2001-10-24 Thread Terrence Brannon
I am trying to write something which opens this file called abstract.sql: select city, date from weather where temp_lo ? and have it $sth-execute(@ARGV) but I am able to get DBI to force an instructive error message when I forget to supply command-line arguments. Instead I get Database

Re: Quick Question

2001-10-22 Thread Terrence Brannon
try this: my %select = ( no_contractor = 'select blah1, blah2 from contractors where (username = ?) and (password = ?)', with_contactor = 'select blah1, blah2 from ap_contractors where (id = ?)' ); my $dbh = DBI-connect(DBI:mysql:$database:$hostname,

Re: Quick Question

2001-10-22 Thread Terrence Brannon
oh and one thing don't ever do anything in DBI or in programming in general without error checking... ie DBI-connect should be DBI-connect or die $DBI::errstr and the same with prepare and execute.. perldoc DBI for details On Monday, October 22, 2001, at 06:58 PM, Terrence Brannon wrote

connect_cached accessibility and persistence question

2001-10-16 Thread Terrence Brannon
I read through the manual entry on connect_cached() and followed on over the reference to CachedKids. Basically connect_cached allows re-use of the same database connection as a function of arguments supplied to connect_cached and insures that the database connecction is good. But I dont know

Re: connect_cached accessibility and persistence question

2001-10-16 Thread Terrence Brannon
On Tuesday, October 16, 2001, at 08:37 AM, Wilson, Doug wrote: 1a - In terms of efficiency, should different processes all be using the same statement handle? Different processes can't use the same statement handle. This was a typo on my part. What I meant was should 2 different modules

RFCs: DBI.pm source code and Module proposal

2001-10-16 Thread Terrence Brannon
As it stands, neither the algorithm or results of DBI's prepare_cached and connect_cached key routines are directly useable in subclasses... in other words the actual key generated is not stored in an attribute of the handle AND the actual algorithm used to generate these keys is inlined and

DBI subclass avoid superclass calling it in infinite loop?

2001-10-16 Thread Terrence Brannon
Stephen, can you give some insight into how normal usage of this DBI subclass might lead to infinite loops via DBI callbacks? I find it surprising that subclasses have to setup this sort of defense for themselves against their parents calling them. sub prepare {

Re: DBI::db::selectall_arrayref somehow reblesses the $dbh argument

2001-10-14 Thread Terrence Brannon
Ok, per request I am showing my code. The first thing I edit was edit DBI.pm,, version 1.19 and do a use Data::Dumper; print Dumper($dbh) in DBD::_::db::selectall_arrayref - sub selectall_arrayref { my ($dbh, $stmt, $attr, @bind) = @_; use Data::Dumper; warn SAR: ,

example code private_* attributes not working for me

2001-10-14 Thread Terrence Brannon
ok, in this module, the standard handle attribute NUM_OF_FIELDS does work perfectly fine for STORE-ing/FETCH-ing $sth fields however, when I try to create a private attribute and fetch it (via the lines $sth-FETCH) i get the standard field but not my private one also, I am aware that

Re: Postgres w/DBI

2001-10-14 Thread Terrence Brannon
On Sunday, October 14, 2001, at 07:25 AM, [EMAIL PROTECTED] wrote: Hello All, We've been using MySQL with Perl/DBI for quiet awhile, and have been looking at trying Postgres. I was wonder how much re-coding is involved if we use our existing scripts with Postgres instead of MySQL??

Re: Postgres w/DBI

2001-10-14 Thread Terrence Brannon
On Sunday, October 14, 2001, at 08:41 AM, Sterin, Ilya wrote: -Original Message- From: Terrence Brannon [mailto:[EMAIL PROTECTED]] Sent: Sunday, October 14, 2001 10:38 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: Postgres w/DBI On Sunday, October 14, 2001

Re: Postgres w/DBI

2001-10-14 Thread Terrence Brannon
On Sunday, October 14, 2001, at 07:48 PM, Ilya Sterin wrote: I tire of stating this and I wonder why people want to gloss over this glaringly obvious fact: SQL varies from vendor to vendor. Definitelly does, but if you stick to the SQL standard than you should have no problems as most

do private_* attributes actually work?

2001-10-13 Thread Terrence Brannon
It would be nice is t/subclass.t were updated with an example of how to use private attributes... Although the STORE of such attributes did not throw an error, I was not able to FETCH them later.