Re: DBI 2.0 interface change request

2004-08-04 Thread John Siracusa
If you change $dbh-{RaiseError}=1 to $dbh-raise_error(1), what is it you are proposing for DBI-connect( ..., {RaiseError=1, PrintError=0} )? Handle attributes are a series of name/value pairs. Er, this is not exactly virgin territory here. Virtually every common post-wild-west-early-days

Re: DBI 2.0 interface change request

2004-08-04 Thread John Siracusa
On Tue, 03 Aug 2004 22:45:46 -0700, Dean Arnold wrote: Hashrefs are declarativeSQL is declarative... Methods are procedural. So? DBI isn't supposed to be SQL, it's supposed to be a database abstraction interface. The structure and syntax of SQL is intentionally separate, so much so that

Re: DBI 2.0 interface change request

2004-08-03 Thread John Siracusa
, what's Perl-ish or not. Sorry, maybe I should have said post-Perl-4-ish ;) On Tue, 3 Aug 2004 10:37:57 +0100, Tim Bunce [EMAIL PROTECTED] wrote: On Mon, Aug 02, 2004 at 07:56:47PM -0400, John Siracusa wrote: Maybe this is DBI 3.0 I'm talking about, or maybe I'll forever be doomed to implement

Re: DBI Driver Developers BoF at OSCON?

2004-07-05 Thread John Siracusa
On 7/5/04 3:45 PM, Tim Bunce wrote: Migration to DBI v2 Speaking of DBI 2, I think I missed out on most of the discussion of what it's going to include. I found this post: http://groups.google.com/groups?selm=20040117154056.GA55164%40dansat.data-pl an.comrnum=1 Is there a more recent summary

Re: Mark II (was: proposed perform_transaction() method)

2004-04-02 Thread John Siracusa
On 4/2/04 6:26 AM, Randal L. Schwartz wrote: sub atomically { my $class = shift; my $action = shift; # coderef local $class-db_Main-{AutoCommit}; # turn off AutoCommit for this block my @result; eval { @result = wantarray ? $action-() : scalar($action-());

Re: DBI version 2 - DBD-specific date parsing and formatting using DateTime

2004-01-19 Thread John Siracusa
On 1/18/04 6:33 PM, Tim Bunce wrote: My preference is that after doing: $sth-bind_column(1, undef, SQL_DATE); $sth-bind_column(2, undef, SQL_DATETIME); $sth-bind_column(3, undef, SQL_TIMESTAMP); the driver should ensure that it returns values for those three column in the corresponding

Re: DBI version 2 - DBD-specific date parsing and formatting using DateTime

2004-01-19 Thread John Siracusa
On 1/19/04 2:22 PM, Tim Bunce wrote: Short answer: no. Can I please have the long answer? :) I really think this type of thing is common enough that, at the very least, there should be convenient hooks for parsing and formatting dates (or possibly any column types). Passing code refs to

Re: DBI version 2 - DBD-specific date parsing and formatting using DateTime

2004-01-19 Thread John Siracusa
On 1/19/04 7:41 PM, Tim Bunce wrote: On Mon, Jan 19, 2004 at 07:19:05PM -0500, John Siracusa wrote: What about the other direction, allowing arbitrary code (\my_deflate_thingie) to run during calls like: $sth-execute($val1, $val2, ...); I'm much less inclined to do that. Smart

Re: DBI version 2 - DBD-specific date parsing and formatting using DateTime

2004-01-18 Thread John Siracusa
On 1/12/04 10:47 AM, Tim Bunce wrote: And this is what I'd like you to be thinking about (mostly directed at driver authors): A. What changes you'd like to see in the DBI API. This topic came up before, when DateTime was just getting off the ground. DateTime is a lot more mature now, and I

Re: commit vs rollback on $dbh-{AutoCommit} = 1 ?

2004-01-13 Thread John Siracusa
On 1/13/04 2:05 AM, Jonathan Leffler wrote: Dean Arnold wrote: On a related note, is there a need/desire for a std. readonly connection attribute to determine if the connection is currently in a transaction ? Yes! I have written more DBI wrappers in my day than I care to remember, and nearly

DBD::Pg 1.31 hangs when fetching array columns

2003-11-21 Thread John Siracusa
DBD::Pg 1.31 builds fine on Mac OS X (10.3.0) and passes all tests, as shown below. But when I try to use it to fetch the value of an ARRAY column, it hangs. Here's how to trigger the bug: test=# create table array_test ( mycol INT[] NOT NULL ); test=# insert into array_test (mycol) VALUES

Re: Time to standardize the ``last insert id'' concept...

2003-03-09 Thread John Siracusa
On 3/9/03 3:21 PM, Tim Bunce wrote: For postgres the tablename_columnname_seq name is part of the core system so there's really no guessing going on (as I understand it). That's only true for the SERIAL pseudo-type's auto-generated sequences. A table could have its primary key column default

Re: Time to standardize the ``last insert id'' concept...

2003-03-08 Thread John Siracusa
Just a quick question on the topic. How far are you willing to go (or willing to let DBD authors go) to support the API you're planning? For example, Postgres has a SERIAL psuedo-type that really just creates a sequence behind the scenes for you. I currently get the last insert id using DBD::Pg

Re: Integrating date and time parsing and formatting

2003-01-21 Thread John Siracusa
On 1/21/03 11:04 AM, John Siracusa wrote: On 1/21/03 10:52 AM, Matt Sergeant wrote: Does this cover DBD's (like mine) that don't support *any* data types? Sure. If you really make no distinctions about data types, then you'd probably just make the methods no-op pass-throughs for the data

Integrating date and time parsing and formatting

2003-01-20 Thread John Siracusa
I just started reading about the new date and time module consolidation project on the [EMAIL PROTECTED] mailing list. The subject of database- specific date and time formats quickly appeared, mostly in the context of how to expose this kind of functionality (a subclass for each database? DB