1Abstracted Types (Stig)
2-----------------------
3
4DB needs a set of types representing the most commonly used types in
5all backends.  This type set could also be geared towards integration
6with things like XML-RPC/SOAP implementations, HTML form classes, etc.
7
8Real Query Parser (Stig)
9------------------------
10
11With a real query parser, DB can implement more of its portability
12based on the query, instead of having support functions for
13everything.  One example would be LIMIT, another "INSERT
14... RETURNING".
15
16Portable transactions (Stig)
17----------------------------
18
19If DB can parse queries enough to determine what tables are affected
20by queries, it should be possible to make a replayable transaction
21log.  GNOME uses an XML format for configuration data that lets you
22checkpoint state once in a while, and revert to that state later.
23With a similar approach for transactions in DB we can implement
24portable transactions and checkpointing even for the databases that
25don't support them.
26
27
28Error reporting clean-up/debug (Tomas)
29-------------------------------------
30Now each driver has its own raiseError method, common has a raiseError and
31DB has a DB_error class and its own isError() method. This error stuff
32overhead could be simplified with only one raiseError, droping the DB Error
33class and also the DB::isError() (use the PEAR.php ones instead).
34Other idea could be to add a system for allowing people access to all the
35queries sended by PEAR DB to the backend. Also a new PEAR_ERROR_DEBUG
36flag that automatically (show|triggers) debug info, perhaps
37with a new PEAR_(Warning|Debug) object.
38
39Quote clean-up (Stig)
40---------------------
411. Keep quote and quoteString, but move quoting of strings back into
42   quoteString and make quote call it for strings.
43
442. Add an optional "operator" parameter to quote that is one of "=",
45   "<", ">" or "<>" that will be inserted in front of the quoted value
46   unless it is NULL, in which case it will be converted to "IS" (for
47   "=") or "IS NOT" (for the others).
48
49Auto free statements (Tomas)
50----------------------------
51By setting a param in query() or for the hole DB instance, PEAR DB
52could auto-free results in DB_result->fetch(Into|Row) when the driver
53returns false.
54
55Datatypes in prepare syntax (Tomas)
56-----------------------------------
57Extend the actual prepare/execute placeholders to support data types, both
58to check the data introduced to the query and to "cast" the result
59to native php data types. Ex:
60
61$sql = "INSERT INTO table VALUES ({{int(4)}}, {{bool}}, {{date('Y-m-d')}})";
62$row = $db->query($sql, array(8, 't', '2001-04-1'));
63
64Format: {{<data_type>(<param1>,<param2>)}}
65
66"param" could be the max lenght of the data, date formats, not_null
67checks or default values.
68
69Other ideas could be:
70
711)
72$sql = "INSERT INTO table VALUES (?, ?, ?)";
73$sth = $db->prepare($sql, array('int(4)', 'bool', 'date');
74$res = $db->execute($sth, array($a, $b, $c);
75
762)
77$sql = "INSERT INTO table VALUES (?, ?, ?)";
78$params = array(
79	0 => array($a, 'int(4)'),
80	1 => array($b, 'bool')
81);
82$res = $db->query($sql, $params);
83
84Auto connect feature (Tomas)
85----------------------------
86Add the ability to create for example a light and dump DB object which
87will only set up the connection when needed. With that people could
88create the DB object in a common prepend or default file without the
89need to waste system resources if the use of the database is finally
90not needed.
91