Sophie

Sophie

distrib > Mandriva > 8.1 > i586 > by-pkgid > 48e23d4c9d95777f2924b3dfbd8400d6 > files > 38

perl-DBI-1.20-1mdk.i586.rpm


*** Assorted to-do items and random thoughts *** in no particular order ***

Foreign key metadata

Update DBI::DBD with overview (at least) recommend Driver.xst strongly.
Find XS drivers that don't use it and talk to authors.
Ship separate DBD::TemplateP and DBD::TemplateXS drivers as examples.

Check/fix: local($h->{PrintError})=0; resets $DBI::errstr at end of scope

Implement _fetchall_arrayref XS
and perhaps within Driver.xst!

ShowTracePid attrib
Add UnimpMethodHook (in XS)
Test and integrate with DProf?
FetchHashReuse attrib (=1 or ={}) copy from dbh to sth.
Record attrib STOREs so can be replayed (or use subclass?)

Add to AdvDBI tutorial trace section: call depth and tainting info

Merge DBIx::AnyDBD functionality into the DBI

make lasth return outer handle

Add $h->swap_internal_handle($other_h)

Add DBI::hash2

make ShowErrorStatement also show the st1 etc? for execute() and do().

Add a C call to return boolean for is a number' for a given SV.
Needs to do the right thing for a non-numeric string SV that's been
tested in a numeric context (eg $a='S23'; foo() if $a==-1; $sth->execute($a))
So if SvNVOK is true but the value is 0 then should also do looks_like_number()
to be sure.

Rename finish to cancel_select :-) [or just add an alias and docs :-]

begin_work
add details of the DBI book to the docs
test shell /connect user etc

document dbi_fetchall_arrayref_attr attr of selectall_arrayref().

passing \$sql or \"...sql..." to $dbh->select methods to mean use prepare_cached?

Count execute()s (and do's?) (in ima struct? not thread safe).
Reset count in commit/rollback.
In $dbh->DESTROY don't issue warning if count == 0.

#define a large negative number to mean 'error' from st_execute and
change *.xst to treat eaither that or -2 as an error. (The -2 is
a transition or old drivers.)

ODBC 3.5 date and intervals types and subtypes (from unixODBC?)

Proxy: allow config to speficy SQL to allow/deny via regexen
Docs for connect_cached and test with proxy.

BINDING:

Add to docs & tutorial re wrong bind type on a param may cause
index to not be used! (Find real examples first)

> And note that if you are using bind_param_inout as 'bind_param_by_ref',
> then the $maxlen parameter is redundant.  I suspect all drivers could
> implement bind_param_by_ref; most drivers, and specifically the Informix
> driver, has no need for bind_param_inout as a mechanism for getting data
> back from the database as there are no methods in the database which
> work like that.  With Informix, values are passed to the database for
> placeholders, and values are returned through a cursor, and that's all.
Okay. I'll take that as a vote for bind_param_by_ref as an alias for
bind_param_inout. >>todo.

Get bind values from statement handle via an attribute.
Useful for diagnostics. Also probably useful for pure-perl drivers.
Also some people want to try to log sql statements with the placeholders
'filled in'.

LOGGING:

Use PerlIO? Change fprintf's to PerlIO_printf's etc.

Seperate log for sql statements?

If trace log_where() says DBI.pm then use caller(1)?

Add per-handle debug file pointer (or at least a macro that _looks_ like that).
Or, better yet, a function pointer so we can do more clever things.
Maybe also need to add locking to prevent file contents being mangled
by multiple threads/interpreters (esp mod_perl v2 and ActivePerl).

OTHERS:

Enable warnings in default_user().
Add prompt for user/pass in default_user()?

Change bind_column to save the info for get_fbav to use when
first called. Thus making bind before execute reliable.

Add a handle flag to say that the driver has a hash that maps error
codes into SQLSTATE values. The error event mechanism could check for
the flag and lookup the SQLSTATE value for the error from the hash.

ODBC attribute defining if transactions are supported

> I had to override
> tables from DBD::_::db because it doesn't handle the quoting
> conventions used by Informix databases.  Basically, table owners
> are case sensitive in some databases, and therefore need to be
> enclosed in double quotes (delimited identifier).
: Needs attribute to say that a) double-quotes can be used
: and b) that names are case sensitive.

$dbh-level __WARN__ and __DIE__. Initially just provide DBIXS hooks
for DBD's to use (and pass h and imp_xxh to). Thus $dbh can redirect
errors etc from all children in one go.

Informix inspired changes.

Detect it in eval block for when PrintError and RaiseError are both set
to avoid duplicated error msg.

Add hook to DBI::DBD to write a myconfig.txt file into the
source directory containing key driver and config info.

attribute for 'last inserted id'?

test suite

$sth->more_results, now and $sth->become($sth2) later

dbish - state AutoCommit status clearly at connect time.
(And try to set AutoCommit off in eval?)

Add thread CV locks (not method locks)
to &DBI::connect and &DBI::connect_cached
in xs dbi_init code.

fetch_scroll handling via get_fbav.
Also add:
	getrow_array       (or getdata_?)
	getrow_arrayref?
	getrow_hashref?

test that $dbh->do will RaiseError
RaiseError in %attr - doc it not working - hints.

Consider making all SQL_ known to the DBI. Want to check for
valid spelling. Also would like C<exists $h->{Attrib}> to
work. Maybe auto load a module that defines a private hash
that just serves to list known attributes.
Or DBI->SQL_FOO and/or DBI::SQL_FOO.

t/shell uninit var at 5.00502/Term/Cap.pm line 284.

check out http://tegan.deltanet.com/~phlip/DBUIframe.html

FAQ check 80 col max

Auto proxying for individual drivers: DBI_PROXY_foo=...
Else more generic dsn-rewrite via env vars

Check DBD::Proxy connect&fetch latency (e.g. CGI use).

Add SCALE to DBD::Sponge

$dbh->get_info?

Rework handle creation for
$h->clone ?, and maybe
$dbh->connect([$user, $passwd])	# to reconnect, possibly as a different user

generic dbd_preparse (for both C and perl)
Add (ODBC) attribute to indicate if placeholders are supported.

Fix shared error codes between (dbh) handles, maybe.

Add problem reporting info to DBI.pm

Metadata! (DBI::Metadata?)

Add 'break handling' when field values change? Use two fbav's so 'previous
record' is available. Defind break fields and handlers. Call them via
an alternate fetch_with_break method.

Add mechanism to optimise
  $sth2->execute(@$row) while ($row = $sth1->fetchrow_arrayref);
maybe just offer an XS method that does just that.

---
> > Is there any way to know whether a particular DBD needs a separate
> > connection for nested operations or not?

Umm, it looks like $dbh->{SQL_ACTIVE_STATEMENTS} would be the one.
It defines the max number of statements that can be active on a
the $dbh. 0 means unknown or no specific limit.
I'll add that to the DBI and DBI spec.

I think drivers that emulate multiple active statements using an
implicit extra dbh but that can't tie the commit/rollback on the
'parent' dbh to the child should probably still set
SQL_ACTIVE_STATEMENTS to just 1. Or maybe 1.1, or 2. I'm open to
suggestion on that one.

-----------
> > > I would prefer to set this attributes on statement level [as 
> > > an attribute to prepare()] instead of setting it via $dbh,
> > > but this is only a detail. 
> > 
> > You can set it any any level. Isn't that clear from the docs?
> 
> As I understand the doc, it is possible to do
> 
>     $sth = $dbh->prepare("....");
>     $sth->execute();
>     $sth->{LongReadLen} = 80;
>     @foo = $sth->fetchrow();
>     $sth->{LongReadLen} = 4096;
>     @bar = $sth->fetchrow(); 
> 
> so that the fetch of the second row is done with a different 
> {LongReadLen} value ? 
> 
> This sounds complicated with the current structure of DBD::Solid,
> as I have only one buffer for the entire row allocated during
> prepare(), but I must admit that I had no time [yet] to look 
> into the last DBD::ODBC how you handle this case.

Umm. I see what you mean. It's reasonable to assume that a driver
will 'freeze' the value of applicable attributes at prepare or execute
time. The driver should probably document that kind of thing.

I think the DBI's template .xst file will probably grow some code
to handle attributes to prepare semi-automatically, sometime.

Tim.
-----------