Add a multi-adapter implementation of Horde_Db_Adapter to support splitread
authorMichael J. Rubinsky <mrubinsk@horde.org>
Fri, 22 Oct 2010 13:49:22 +0000 (09:49 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Fri, 22 Oct 2010 13:49:22 +0000 (09:49 -0400)
framework/Core/lib/Horde/Core/Factory/Db.php
framework/Db/lib/Horde/Db/Adapter/SplitRead.php [new file with mode: 0644]
framework/Db/package.xml

index 79c0ea6..7c5c17e 100644 (file)
@@ -112,10 +112,13 @@ class Horde_Core_Factory_Db
      */
     protected function _createDb($config)
     {
+        // Split read?
         if (!empty($config['splitread'])) {
             unset($config['splitread']);
-            $config['write_db'] = $this->_createDb($config);
+            $write_db = $this->_createDb($config);
             $config = array_merge($config, $config['read']);
+            $read_db = $this->_createDb($config);
+            return new Horde_Db_Adapter_SplitRead($read_db, $write_db);
         }
 
         if (!isset($config['adapter'])) {
@@ -143,10 +146,7 @@ class Horde_Core_Factory_Db
         $class = 'Horde_Db_Adapter_' . $adapter;
 
         if (class_exists($class)) {
-            unset($config['read'],
-                  $config['write_db'],
-                  $config['hostspec'],
-                  $config['splitread']);
+            unset($config['hostspec'], $config['splitread']);
             $ob = new $class($config);
 
             if (!isset($config['cache'])) {
diff --git a/framework/Db/lib/Horde/Db/Adapter/SplitRead.php b/framework/Db/lib/Horde/Db/Adapter/SplitRead.php
new file mode 100644 (file)
index 0000000..903929e
--- /dev/null
@@ -0,0 +1,418 @@
+<?php
+/**
+ * Copyright 2007 Maintainable Software, LLC
+ * Copyright 2008-2010 The Horde Project (http://www.horde.org/)
+ *
+ * @author     Mike Naberezny <mike@maintainable.com>
+ * @author     Derek DeVries <derek@maintainable.com>
+ * @author     Chuck Hagenbuch <chuck@horde.org>
+ * @author     Michael J. Rubinsky <mrubinsk@horde.org>
+ * @license    http://opensource.org/licenses/bsd-license.php
+ * @category   Horde
+ * @package    Horde_Db
+ * @subpackage Adapter
+ */
+
+/**
+ * The Horde_Db_Adapter_SplitRead:: class wraps two individual adapters to
+ * provide support for split read/write database setups.
+ *
+ * @author     Mike Naberezny <mike@maintainable.com>
+ * @author     Derek DeVries <derek@maintainable.com>
+ * @author     Chuck Hagenbuch <chuck@horde.org>
+ * @author     Michael J. Rubinsky <mrubinsk@horde.org>
+ * @license    http://opensource.org/licenses/bsd-license.php
+ * @category   Horde
+ * @package    Horde_Db
+ * @subpackage Adapter
+ */
+class Horde_Db_Adapter_SplitRead implements Horde_Db_Adapter
+{
+    /**
+     * The read adapter
+     *
+     * @var Horde_Db_Adapter
+     */
+    private $_read;
+    
+    /**
+     * The write adapter
+     * 
+     * @var Horde_Db_Adapter
+     */
+    private $_write;
+
+    /**
+     * Const'r
+     *
+     * @param Horde_Db_Adapter $read
+     * @param Horde_Db_Adapter $write
+     */
+    public function __construct(Horde_Db_Adapter $read, Horde_Db_Adapter $write)
+    {
+        $this->_read = $read;
+        $this->_write = $write;
+    }
+
+    /**
+     * Delegate unknown methods to the _write adapter.
+     *
+     * @param string $method
+     * @param array $args
+     */
+    public function __call($method, $args)
+    {
+        return call_user_func_array(array($this->_write, $method), $args);
+    }
+
+    /**
+     * Returns the human-readable name of the adapter.  Use mixed case - one
+     * can always use downcase if needed.
+     *
+     * @return string
+     */
+    public function adapterName()
+    {
+        return 'SplitRead';
+    }
+
+    /**
+     * Does this adapter support migrations? 
+     *
+     * @return boolean
+     */
+    public function supportsMigrations()
+    {
+        return $this->_write->supportsMigrations();
+    }
+
+    /**
+     * Does this adapter support using DISTINCT within COUNT?  This is +true+
+     * for all adapters except sqlite.
+     *
+     * @return boolean
+     */
+    public function supportsCountDistinct()
+    {
+        return $this->_read->supportsCountDistinct();
+    }
+
+    /**
+     * Should primary key values be selected from their corresponding
+     * sequence before the insert statement?  If true, next_sequence_value
+     * is called before each insert to set the record's primary key.
+     * This is false for all adapters but Firebird.
+     *
+     * @return boolean
+     */
+    public function prefetchPrimaryKey($tableName = null)
+    {
+        return $this->_write->prefetchPrimaryKey($tableName);
+    }
+
+    /*##########################################################################
+    # Connection Management
+    ##########################################################################*/
+
+    /**
+     * Connect to the db.
+     * @TODO: Lazy connect?
+     *
+     */
+    public function connect()
+    {
+        $this->_write->connect();
+        $this->_read->connect();
+    }
+
+    /**
+     * Is the connection active?
+     *
+     * @return boolean
+     */
+    public function isActive()
+    {
+        return ($this->_read->isActive() && $this->_write->isActive());
+    }
+
+    /**
+     * Reconnect to the db.
+     */
+    public function reconnect()
+    {
+        $this->disconnect();
+        $this->connect();
+    }
+
+    /**
+     * Disconnect from db.
+     */
+    public function disconnect()
+    {
+        $this->_read->disconnect();
+        $this->_write->disconnect();
+    }
+
+    /**
+     * Provides access to the underlying database connection. Useful for when
+     * you need to call a proprietary method such as postgresql's
+     * lo_* methods.
+     *
+     * @return resource
+     */
+    public function rawConnection()
+    {
+        return $this->_write->rawConnection();
+    }
+
+
+    /*##########################################################################
+    # Database Statements
+    ##########################################################################*/
+
+    /**
+     * Returns an array of records with the column names as keys, and
+     * column values as values.
+     *
+     * @param string  $sql   SQL statement.
+     * @param mixed $arg1    Either an array of bound parameters or a query
+     *                       name.
+     * @param string $arg2   If $arg1 contains bound parameters, the query
+     *                       name.
+     *
+     * @return PDOStatement
+     * @throws Horde_Db_Exception
+     */
+    public function select($sql, $arg1 = null, $arg2 = null)
+    {
+        return $this->_read->select($sql, $arg1, $arg2);
+    }
+
+    /**
+     * Returns an array of record hashes with the column names as keys and
+     * column values as values.
+     *
+     * @param string $sql   SQL statement.
+     * @param mixed $arg1   Either an array of bound parameters or a query
+     *                      name.
+     * @param string $arg2  If $arg1 contains bound parameters, the query
+     *                      name.
+     *
+     * @return array
+     * @throws Horde_Db_Exception
+     */
+    public function selectAll($sql, $arg1 = null, $arg2 = null)
+    {
+        return $this->_read->selectAll($sql, $arg1, $arg2);
+    }
+
+    /**
+     * Returns a record hash with the column names as keys and column values
+     * as values.
+     *
+     * @param string $sql   SQL statement.
+     * @param mixed $arg1   Either an array of bound parameters or a query
+     *                      name.
+     * @param string $arg2  If $arg1 contains bound parameters, the query
+     *                      name.
+     *
+     * @return array
+     * @throws Horde_Db_Exception
+     */
+    public function selectOne($sql, $arg1 = null, $arg2 = null)
+    {
+        return $this->_read->selectOne($sql, $arg1, $arg2);
+    }
+
+    /**
+     * Returns a single value from a record
+     *
+     * @param string $sql   SQL statement.
+     * @param mixed $arg1   Either an array of bound parameters or a query
+     *                      name.
+     * @param string $arg2  If $arg1 contains bound parameters, the query
+     *                      name.
+     *
+     * @return string
+     * @throws Horde_Db_Exception
+     */
+    public function selectValue($sql, $arg1 = null, $arg2 = null)
+    {
+        return $this->_read->selectValue($sql, $arg1, $arg2);
+    }
+
+    /**
+     * Returns an array of the values of the first column in a select:
+     *   selectValues("SELECT id FROM companies LIMIT 3") => [1,2,3]
+     *
+     * @param string $sql   SQL statement.
+     * @param mixed $arg1   Either an array of bound parameters or a query
+     *                      name.
+     * @param string $arg2  If $arg1 contains bound parameters, the query
+     *                      name.
+     *
+     * @return array
+     * @throws Horde_Db_Exception
+     */
+    public function selectValues($sql, $arg1 = null, $arg2 = null)
+    {
+        return $this->_read->selectValues($sql, $arg1, $arg2);
+    }
+
+    /**
+     * Returns an array where the keys are the first column of a select, and the
+     * values are the second column:
+     *
+     *   selectAssoc("SELECT id, name FROM companies LIMIT 3") => [1 => 'Ford', 2 => 'GM', 3 => 'Chrysler']
+     *
+     * @param string $sql   SQL statement.
+     * @param mixed $arg1   Either an array of bound parameters or a query
+     *                      name.
+     * @param string $arg2  If $arg1 contains bound parameters, the query
+     *                      name.
+     *
+     * @return array
+     * @throws Horde_Db_Exception
+     */
+    public function selectAssoc($sql, $arg1 = null, $arg2 = null)
+    {
+        return $this->_read->selectAssoc($sql, $arg1, $arg2);
+    }
+
+    /**
+     * Executes the SQL statement in the context of this connection.
+     *
+     * @param string $sql   SQL statement.
+     * @param mixed $arg1   Either an array of bound parameters or a query
+     *                      name.
+     * @param string $arg2  If $arg1 contains bound parameters, the query
+     *                      name.
+     *
+     * @return PDOStatement
+     * @throws Horde_Db_Exception
+     */
+    public function execute($sql, $arg1 = null, $arg2 = null)
+    {
+        // Can't assume this will always be a read action, use _write.
+        return $this->_write->execute($sql, $arg1, $arg2);
+    }
+
+    /**
+     * Returns the last auto-generated ID from the affected table.
+     *
+     * @param string $sql           SQL statement.
+     * @param mixed $arg1           Either an array of bound parameters or a
+     *                              query name.
+     * @param string $arg2          If $arg1 contains bound parameters, the
+     *                              query name.
+     * @param string $pk            TODO
+     * @param integer $idValue      TODO
+     * @param string $sequenceName  TODO
+     *
+     * @return integer  Last inserted ID.
+     * @throws Horde_Db_Exception
+     */
+    public function insert($sql, $arg1 = null, $arg2 = null, $pk = null,
+                           $idValue = null, $sequenceName = null)
+    {
+        return $this->_write->insert($sql, $arg1, $arg2, $pk, $idValue, $sequenceName);
+    }
+
+    /**
+     * Executes the update statement and returns the number of rows affected.
+     *
+     * @param string $sql   SQL statement.
+     * @param mixed $arg1   Either an array of bound parameters or a query
+     *                      name.
+     * @param string $arg2  If $arg1 contains bound parameters, the query
+     *                      name.
+     *
+     * @return integer  Number of rows affected.
+     * @throws Horde_Db_Exception
+     */
+    public function update($sql, $arg1 = null, $arg2 = null)
+    {
+        return $this->_write->update($sql, $arg1, $arg2);
+    }
+
+    /**
+     * Executes the delete statement and returns the number of rows affected.
+     *
+     * @param string $sql   SQL statement.
+     * @param mixed $arg1   Either an array of bound parameters or a query
+     *                      name.
+     * @param string $arg2  If $arg1 contains bound parameters, the query
+     *                      name.
+     *
+     * @return integer  Number of rows affected.
+     * @throws Horde_Db_Exception
+     */
+    public function delete($sql, $arg1 = null, $arg2 = null)
+    {
+        return $this->_write->delete($sql, $arg1, $arg2);
+    }
+
+    /**
+     * Check if a transaction has been started.
+     *
+     * @return boolean  True if transaction has been started.
+     */
+    public function transactionStarted()
+    {
+        return $this->_write->transactionStarted();
+    }
+    /**
+     * Begins the transaction (and turns off auto-committing).
+     */
+    public function beginDbTransaction()
+    {
+        return $this->_write->beginDbTransaction();
+    }
+
+    /**
+     * Commits the transaction (and turns on auto-committing).
+     */
+    public function commitDbTransaction()
+    {
+        return $this->_write->commitDbTransaction();
+    }
+
+    /**
+     * Rolls back the transaction (and turns on auto-committing). Must be
+     * done if the transaction block raises an exception or returns false.
+     */
+    public function rollbackDbTransaction()
+    {
+       return $this->_write->rollbackDbTransaction();
+    }
+
+    /**
+     * Appends +LIMIT+ and +OFFSET+ options to a SQL statement.
+     *
+     * @param string $sql     SQL statement.
+     * @param array $options  TODO
+     *
+     * @return string
+     */
+    public function addLimitOffset($sql, $options)
+    {
+        return $this->_read->addLimitOffset($sql, $options);
+    }
+
+    /**
+     * Appends a locking clause to an SQL statement.
+     * This method *modifies* the +sql+ parameter.
+     *
+     *   # SELECT * FROM suppliers FOR UPDATE
+     *   add_lock! 'SELECT * FROM suppliers', :lock => true
+     *   add_lock! 'SELECT * FROM suppliers', :lock => ' FOR UPDATE'
+     *
+     * @param string &$sql    SQL statment.
+     * @param array $options  TODO.
+     */
+    public function addLock(&$sql, array $options = array())
+    {
+        $this->_write->addLock(&$sql, $options);
+    }
+
+}
index d308578..5138589 100644 (file)
@@ -1,13 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<package packagerversion="1.4.9" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0
-http://pear.php.net/dtd/tasks-1.0.xsd
-http://pear.php.net/dtd/package-2.0
-http://pear.php.net/dtd/package-2.0.xsd">
+<package packagerversion="1.9.1" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
  <name>Db</name>
  <channel>pear.horde.org</channel>
  <summary>Horde Database Libraries</summary>
- <description>Horde Database/SQL abstraction layer
- </description>
+ <description>Horde Database/SQL abstraction layer</description>
  <lead>
   <name>Mike Naberezny</name>
   <user>mnaberez</user>
@@ -20,7 +16,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
   <email>chuck@horde.org</email>
   <active>yes</active>
  </lead>
- <date>2008-09-19</date>
+ <date>2010-10-22</date>
+ <time>09:45:53</time>
  <version>
   <release>0.1.0</release>
   <api>0.1.0</api>
@@ -30,11 +27,16 @@ http://pear.php.net/dtd/package-2.0.xsd">
   <api>beta</api>
  </stability>
  <license uri="http://opensource.org/licenses/bsd-license.php">BSD</license>
- <notes>* Add support for adding autoincrement to a column.
+ <notes>
+* Add support for adding autoincrement to a column.
  * Initial release
  </notes>
  <contents>
-  <dir name="/">
+  <dir baseinstalldir="/" name="/">
+   <dir name="doc">
+    <file name="README.TESTING.txt" role="doc" />
+    <file name="TODO.txt" role="doc" />
+   </dir> <!-- /doc -->
    <dir name="lib">
     <dir name="Horde">
      <dir name="Db">
@@ -72,6 +74,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
        <file name="Base.php" role="php" />
        <file name="Mysql.php" role="php" />
        <file name="Mysqli.php" role="php" />
+       <file name="SplitRead.php" role="php" />
+       <file name="SplitWrite.php" role="php" />
       </dir> <!-- /lib/Horde/Db/Adapter -->
       <dir name="Migration">
        <file name="Base.php" role="php" />
@@ -84,6 +88,73 @@ http://pear.php.net/dtd/package-2.0.xsd">
      </dir> <!-- /lib/Horde/Db -->
     </dir> <!-- /lib/Horde -->
    </dir> <!-- /lib -->
+   <dir name="test">
+    <dir name="Horde">
+     <dir name="Db">
+      <dir name="Adapter">
+       <dir name="Mysql">
+        <file name="ColumnDefinitionTest.php" role="test" />
+        <file name="ColumnTest.php" role="test" />
+        <file name="TableDefinitionTest.php" role="test" />
+       </dir> <!-- /test/Horde/Db/Adapter/Mysql -->
+       <dir name="Pdo">
+        <file name="MysqlSuite.php" role="test" />
+        <file name="MysqlTest.php" role="test" />
+        <file name="PgsqlSuite.php" role="test" />
+        <file name="PgsqlTest.php" role="test" />
+        <file name="SqliteSuite.php" role="test" />
+        <file name="SqliteTest.php" role="test" />
+       </dir> <!-- /test/Horde/Db/Adapter/Pdo -->
+       <dir name="Postgresql">
+        <file name="ColumnDefinitionTest.php" role="test" />
+        <file name="ColumnTest.php" role="test" />
+        <file name="TableDefinitionTest.php" role="test" />
+       </dir> <!-- /test/Horde/Db/Adapter/Postgresql -->
+       <dir name="Sqlite">
+        <file name="ColumnDefinitionTest.php" role="test" />
+        <file name="ColumnTest.php" role="test" />
+        <file name="TableDefinitionTest.php" role="test" />
+       </dir> <!-- /test/Horde/Db/Adapter/Sqlite -->
+       <file name="conf.php.dist" role="test" />
+       <file name="MissingTest.php" role="test" />
+       <file name="MysqliSuite.php" role="test" />
+       <file name="MysqliTest.php" role="test" />
+       <file name="MysqlSuite.php" role="test" />
+       <file name="MysqlTest.php" role="test" />
+      </dir> <!-- /test/Horde/Db/Adapter -->
+      <dir name="fixtures">
+       <dir name="migrations">
+        <file name="1_users_have_last_names1.php" role="test" />
+        <file name="2_we_need_reminders1.php" role="test" />
+        <file name="3_innocent_jointable1.php" role="test" />
+       </dir> <!-- /test/Horde/Db/fixtures/migrations -->
+       <dir name="migrations_with_decimal">
+        <file name="1_give_me_big_numbers.php" role="test" />
+       </dir> <!-- /test/Horde/Db/fixtures/migrations_with_decimal -->
+       <dir name="migrations_with_duplicate">
+        <file name="1_users_have_last_names2.php" role="test" />
+        <file name="2_we_need_reminders2.php" role="test" />
+        <file name="3_foo.php" role="test" />
+        <file name="3_innocent_jointable2.php" role="test" />
+       </dir> <!-- /test/Horde/Db/fixtures/migrations_with_duplicate -->
+       <dir name="migrations_with_missing_versions">
+        <file name="1_users_have_last_names3.php" role="test" />
+        <file name="3_we_need_reminders.php" role="test" />
+        <file name="4_innocent_jointable3.php" role="test" />
+        <file name="1000_users_have_middle_names.php" role="test" />
+       </dir> <!-- /test/Horde/Db/fixtures/migrations_with_missing_versions -->
+       <file name="drop_create_table.sql" role="test" />
+       <file name="unit_tests.sql" role="test" />
+      </dir> <!-- /test/Horde/Db/fixtures -->
+      <dir name="Migration">
+       <file name="BaseTest.php" role="test" />
+       <file name="MigratorTest.php" role="test" />
+      </dir> <!-- /test/Horde/Db/Migration -->
+      <file name="AllTests.php" role="test" />
+      <file name="StatementParserTest.php" role="test" />
+     </dir> <!-- /test/Horde/Db -->
+    </dir> <!-- /test/Horde -->
+   </dir> <!-- /test -->
   </dir> <!-- / -->
  </contents>
  <dependencies>
@@ -112,40 +183,94 @@ http://pear.php.net/dtd/package-2.0.xsd">
  </dependencies>
  <phprelease>
   <filelist>
-   <install name="lib/Horde/Db/Adapter/Base/Column.php" as="Horde/Db/Adapter/Base/Column.php" />
-   <install name="lib/Horde/Db/Adapter/Base/ColumnDefinition.php" as="Horde/Db/Adapter/Base/ColumnDefinition.php" />
-   <install name="lib/Horde/Db/Adapter/Base/Index.php" as="Horde/Db/Adapter/Base/Index.php" />
-   <install name="lib/Horde/Db/Adapter/Base/Schema.php" as="Horde/Db/Adapter/Base/Schema.php" />
-   <install name="lib/Horde/Db/Adapter/Base/Table.php" as="Horde/Db/Adapter/Base/Table.php" />
-   <install name="lib/Horde/Db/Adapter/Base/TableDefinition.php" as="Horde/Db/Adapter/Base/TableDefinition.php" />
-   <install name="lib/Horde/Db/Adapter/Base.php" as="Horde/Db/Adapter/Base.php" />
-
-   <install name="lib/Horde/Db/Adapter/Mysql/Column.php" as="Horde/Db/Adapter/Mysql/Column.php" />
-   <install name="lib/Horde/Db/Adapter/Mysql/Result.php" as="Horde/Db/Adapter/Mysql/Result.php" />
-   <install name="lib/Horde/Db/Adapter/Mysql/Schema.php" as="Horde/Db/Adapter/Mysql/Schema.php" />
-   <install name="lib/Horde/Db/Adapter/Mysql.php" as="Horde/Db/Adapter/Mysql.php" />
-
-   <install name="lib/Horde/Db/Adapter/Mysqli/Result.php" as="Horde/Db/Adapter/Mysqli/Result.php" />
-   <install name="lib/Horde/Db/Adapter/Mysqli.php" as="Horde/Db/Adapter/Mysqli.php" />
-
-   <install name="lib/Horde/Db/Adapter/Pdo/Base.php" as="Horde/Db/Adapter/Pdo/Base.php" />
-   <install name="lib/Horde/Db/Adapter/Pdo/Mysql.php" as="Horde/Db/Adapter/Pdo/Mysql.php" />
-   <install name="lib/Horde/Db/Adapter/Pdo/Pgsql.php" as="Horde/Db/Adapter/Pdo/Pgsql.php" />
-   <install name="lib/Horde/Db/Adapter/Pdo/Sqlite.php" as="Horde/Db/Adapter/Pdo/Sqlite.php" />
-
-   <install name="lib/Horde/Db/Adapter/Postgresql/Column.php" as="Horde/Db/Adapter/Postgresql/Column.php" />
-   <install name="lib/Horde/Db/Adapter/Postgresql/Schema.php" as="Horde/Db/Adapter/Postgresql/Schema.php" />
-
-   <install name="lib/Horde/Db/Adapter/Sqlite/Column.php" as="Horde/Db/Adapter/Sqlite/Column.php" />
-   <install name="lib/Horde/Db/Adapter/Sqlite/Schema.php" as="Horde/Db/Adapter/Sqlite/Schema.php" />
-
-   <install name="lib/Horde/Db/Migration/Base.php" as="Horde/Db/Migration/Base.php" />
-   <install name="lib/Horde/Db/Migration/Exception.php" as="Horde/Db/Migration/Exception.php" />
-   <install name="lib/Horde/Db/Migration/Migrator.php" as="Horde/Db/Migration/Migrator.php" />
-
-   <install name="lib/Horde/Db/Adapter.php" as="Horde/Db/Adapter.php" />
-   <install name="lib/Horde/Db/Exception.php" as="Horde/Db/Exception.php" />
-   <install name="lib/Horde/Db/StatementParser.php" as="Horde/Db/StatementParser.php" />
+   <install as="README.TESTING.txt" name="doc/README.TESTING.txt" />
+   <install as="TODO.txt" name="doc/TODO.txt" />
+   <install as="Horde/Db/Adapter.php" name="lib/Horde/Db/Adapter.php" />
+   <install as="Horde/Db/Exception.php" name="lib/Horde/Db/Exception.php" />
+   <install as="Horde/Db/StatementParser.php" name="lib/Horde/Db/StatementParser.php" />
+   <install as="Horde/Db/Adapter/Base.php" name="lib/Horde/Db/Adapter/Base.php" />
+   <install as="Horde/Db/Adapter/Mysql.php" name="lib/Horde/Db/Adapter/Mysql.php" />
+   <install as="Horde/Db/Adapter/Mysqli.php" name="lib/Horde/Db/Adapter/Mysqli.php" />
+   <install as="Horde/Db/Adapter/SplitRead.php" name="lib/Horde/Db/Adapter/SplitRead.php" />
+   <install as="Horde/Db/Adapter/SplitWrite.php" name="lib/Horde/Db/Adapter/SplitWrite.php" />
+   <install as="Horde/Db/Adapter/Base/Column.php" name="lib/Horde/Db/Adapter/Base/Column.php" />
+   <install as="Horde/Db/Adapter/Base/ColumnDefinition.php" name="lib/Horde/Db/Adapter/Base/ColumnDefinition.php" />
+   <install as="Horde/Db/Adapter/Base/Index.php" name="lib/Horde/Db/Adapter/Base/Index.php" />
+   <install as="Horde/Db/Adapter/Base/Schema.php" name="lib/Horde/Db/Adapter/Base/Schema.php" />
+   <install as="Horde/Db/Adapter/Base/Table.php" name="lib/Horde/Db/Adapter/Base/Table.php" />
+   <install as="Horde/Db/Adapter/Base/TableDefinition.php" name="lib/Horde/Db/Adapter/Base/TableDefinition.php" />
+   <install as="Horde/Db/Adapter/Mysql/Column.php" name="lib/Horde/Db/Adapter/Mysql/Column.php" />
+   <install as="Horde/Db/Adapter/Mysql/Result.php" name="lib/Horde/Db/Adapter/Mysql/Result.php" />
+   <install as="Horde/Db/Adapter/Mysql/Schema.php" name="lib/Horde/Db/Adapter/Mysql/Schema.php" />
+   <install as="Horde/Db/Adapter/Mysqli/Result.php" name="lib/Horde/Db/Adapter/Mysqli/Result.php" />
+   <install as="Horde/Db/Adapter/Pdo/Base.php" name="lib/Horde/Db/Adapter/Pdo/Base.php" />
+   <install as="Horde/Db/Adapter/Pdo/Mysql.php" name="lib/Horde/Db/Adapter/Pdo/Mysql.php" />
+   <install as="Horde/Db/Adapter/Pdo/Pgsql.php" name="lib/Horde/Db/Adapter/Pdo/Pgsql.php" />
+   <install as="Horde/Db/Adapter/Pdo/Sqlite.php" name="lib/Horde/Db/Adapter/Pdo/Sqlite.php" />
+   <install as="Horde/Db/Adapter/Postgresql/Column.php" name="lib/Horde/Db/Adapter/Postgresql/Column.php" />
+   <install as="Horde/Db/Adapter/Postgresql/Schema.php" name="lib/Horde/Db/Adapter/Postgresql/Schema.php" />
+   <install as="Horde/Db/Adapter/Sqlite/Column.php" name="lib/Horde/Db/Adapter/Sqlite/Column.php" />
+   <install as="Horde/Db/Adapter/Sqlite/Schema.php" name="lib/Horde/Db/Adapter/Sqlite/Schema.php" />
+   <install as="Horde/Db/Migration/Base.php" name="lib/Horde/Db/Migration/Base.php" />
+   <install as="Horde/Db/Migration/Exception.php" name="lib/Horde/Db/Migration/Exception.php" />
+   <install as="Horde/Db/Migration/Migrator.php" name="lib/Horde/Db/Migration/Migrator.php" />
+   <install as="Horde/Db/AllTests.php" name="test/Horde/Db/AllTests.php" />
+   <install as="Horde/Db/StatementParserTest.php" name="test/Horde/Db/StatementParserTest.php" />
+   <install as="Horde/Db/Adapter/conf.php.dist" name="test/Horde/Db/Adapter/conf.php.dist" />
+   <install as="Horde/Db/Adapter/MissingTest.php" name="test/Horde/Db/Adapter/MissingTest.php" />
+   <install as="Horde/Db/Adapter/MysqliSuite.php" name="test/Horde/Db/Adapter/MysqliSuite.php" />
+   <install as="Horde/Db/Adapter/MysqliTest.php" name="test/Horde/Db/Adapter/MysqliTest.php" />
+   <install as="Horde/Db/Adapter/MysqlSuite.php" name="test/Horde/Db/Adapter/MysqlSuite.php" />
+   <install as="Horde/Db/Adapter/MysqlTest.php" name="test/Horde/Db/Adapter/MysqlTest.php" />
+   <install as="Horde/Db/Adapter/Mysql/ColumnDefinitionTest.php" name="test/Horde/Db/Adapter/Mysql/ColumnDefinitionTest.php" />
+   <install as="Horde/Db/Adapter/Mysql/ColumnTest.php" name="test/Horde/Db/Adapter/Mysql/ColumnTest.php" />
+   <install as="Horde/Db/Adapter/Mysql/TableDefinitionTest.php" name="test/Horde/Db/Adapter/Mysql/TableDefinitionTest.php" />
+   <install as="Horde/Db/Adapter/Pdo/MysqlSuite.php" name="test/Horde/Db/Adapter/Pdo/MysqlSuite.php" />
+   <install as="Horde/Db/Adapter/Pdo/MysqlTest.php" name="test/Horde/Db/Adapter/Pdo/MysqlTest.php" />
+   <install as="Horde/Db/Adapter/Pdo/PgsqlSuite.php" name="test/Horde/Db/Adapter/Pdo/PgsqlSuite.php" />
+   <install as="Horde/Db/Adapter/Pdo/PgsqlTest.php" name="test/Horde/Db/Adapter/Pdo/PgsqlTest.php" />
+   <install as="Horde/Db/Adapter/Pdo/SqliteSuite.php" name="test/Horde/Db/Adapter/Pdo/SqliteSuite.php" />
+   <install as="Horde/Db/Adapter/Pdo/SqliteTest.php" name="test/Horde/Db/Adapter/Pdo/SqliteTest.php" />
+   <install as="Horde/Db/Adapter/Postgresql/ColumnDefinitionTest.php" name="test/Horde/Db/Adapter/Postgresql/ColumnDefinitionTest.php" />
+   <install as="Horde/Db/Adapter/Postgresql/ColumnTest.php" name="test/Horde/Db/Adapter/Postgresql/ColumnTest.php" />
+   <install as="Horde/Db/Adapter/Postgresql/TableDefinitionTest.php" name="test/Horde/Db/Adapter/Postgresql/TableDefinitionTest.php" />
+   <install as="Horde/Db/Adapter/Sqlite/ColumnDefinitionTest.php" name="test/Horde/Db/Adapter/Sqlite/ColumnDefinitionTest.php" />
+   <install as="Horde/Db/Adapter/Sqlite/ColumnTest.php" name="test/Horde/Db/Adapter/Sqlite/ColumnTest.php" />
+   <install as="Horde/Db/Adapter/Sqlite/TableDefinitionTest.php" name="test/Horde/Db/Adapter/Sqlite/TableDefinitionTest.php" />
+   <install as="Horde/Db/fixtures/drop_create_table.sql" name="test/Horde/Db/fixtures/drop_create_table.sql" />
+   <install as="Horde/Db/fixtures/unit_tests.sql" name="test/Horde/Db/fixtures/unit_tests.sql" />
+   <install as="Horde/Db/fixtures/migrations/1_users_have_last_names1.php" name="test/Horde/Db/fixtures/migrations/1_users_have_last_names1.php" />
+   <install as="Horde/Db/fixtures/migrations/2_we_need_reminders1.php" name="test/Horde/Db/fixtures/migrations/2_we_need_reminders1.php" />
+   <install as="Horde/Db/fixtures/migrations/3_innocent_jointable1.php" name="test/Horde/Db/fixtures/migrations/3_innocent_jointable1.php" />
+   <install as="Horde/Db/fixtures/migrations_with_decimal/1_give_me_big_numbers.php" name="test/Horde/Db/fixtures/migrations_with_decimal/1_give_me_big_numbers.php" />
+   <install as="Horde/Db/fixtures/migrations_with_duplicate/1_users_have_last_names2.php" name="test/Horde/Db/fixtures/migrations_with_duplicate/1_users_have_last_names2.php" />
+   <install as="Horde/Db/fixtures/migrations_with_duplicate/2_we_need_reminders2.php" name="test/Horde/Db/fixtures/migrations_with_duplicate/2_we_need_reminders2.php" />
+   <install as="Horde/Db/fixtures/migrations_with_duplicate/3_foo.php" name="test/Horde/Db/fixtures/migrations_with_duplicate/3_foo.php" />
+   <install as="Horde/Db/fixtures/migrations_with_duplicate/3_innocent_jointable2.php" name="test/Horde/Db/fixtures/migrations_with_duplicate/3_innocent_jointable2.php" />
+   <install as="Horde/Db/fixtures/migrations_with_missing_versions/1_users_have_last_names3.php" name="test/Horde/Db/fixtures/migrations_with_missing_versions/1_users_have_last_names3.php" />
+   <install as="Horde/Db/fixtures/migrations_with_missing_versions/3_we_need_reminders.php" name="test/Horde/Db/fixtures/migrations_with_missing_versions/3_we_need_reminders.php" />
+   <install as="Horde/Db/fixtures/migrations_with_missing_versions/4_innocent_jointable3.php" name="test/Horde/Db/fixtures/migrations_with_missing_versions/4_innocent_jointable3.php" />
+   <install as="Horde/Db/fixtures/migrations_with_missing_versions/1000_users_have_middle_names.php" name="test/Horde/Db/fixtures/migrations_with_missing_versions/1000_users_have_middle_names.php" />
+   <install as="Horde/Db/Migration/BaseTest.php" name="test/Horde/Db/Migration/BaseTest.php" />
+   <install as="Horde/Db/Migration/MigratorTest.php" name="test/Horde/Db/Migration/MigratorTest.php" />
   </filelist>
  </phprelease>
+ <changelog>
+  <release>
+   <version>
+    <release>0.1.0</release>
+    <api>0.1.0</api>
+   </version>
+   <stability>
+    <release>beta</release>
+    <api>beta</api>
+   </stability>
+   <date>2010-10-22</date>
+   <license uri="http://opensource.org/licenses/bsd-license.php">BSD</license>
+   <notes>
+* Add support for adding autoincrement to a column.
+ * Initial release
+   </notes>
+  </release>
+ </changelog>
 </package>