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
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
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
/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]
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
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
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
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
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
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:
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
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
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
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.
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,
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,
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
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
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
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.
---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
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
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:
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
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
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
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
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
[ 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
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
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.
It appears that this module does not have docs and I have no idea
what is useful for, but would appreciate some pointers...
Thanks.
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,
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
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,
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?
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
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
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
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
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
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
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
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
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
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
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
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
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
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,
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,
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
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
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
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
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,
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
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
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
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
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 {
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: ,
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
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??
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
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
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.
67 matches
Mail list logo