Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Akiban driver #188

Closed
wants to merge 91 commits into from

4 participants

Padraig O'Sullivan Don't Add Me To Your Organization a.k.a The Travis Bot Christophe Coevoet Benjamin Eberlei
Padraig O'Sullivan

An initial implementation of a driver for the Akiban Server. You will notice in the diff there are some features Akiban does not yet support in its latest release but are planned for future releases.

I wasn't sure if pull request was the best way to start a dialog to get this work accepted or whether the mailing list is more appropriate. Please let me know and I will do as suggested.

I am an engineer at Akiban and am very willing to maintain/improve this driver.

added some commits August 10, 2012
Padraig O'Sullivan Add akibansrv to list of available drivers in DriverManager class. 16e0692
Padraig O'Sullivan Add simple implementation of Driver interface for Akiban Server. aba8430
Padraig O'Sullivan Simple implementation of Connection interface for Akiban Server. Not …
…all methods are implemented yet.
2fe3944
Padraig O'Sullivan Add simple exception wrapper for AkibanSrv exceptions. 2851f2c
Padraig O'Sullivan Add skeleton for AkibanSrvStatement class that implements Statement i…
…nterface. Nearly all methods still need to be implemented.
6ce2ae9
Padraig O'Sullivan Add skeleton for Akiban Server schema manager. c5e757f
Padraig O'Sullivan Skeleton for AkibanServerPlatform implementation. Most methods need t…
…o be implemented.
c750b4e
Padraig O'Sullivan Update akiban driver implementation to use correct names for platform…
… and schema manager implementations.
b5e6946
Padraig O'Sullivan Update function for getting next sequence value. 4ad4453
Padraig O'Sullivan Implement function for generating SQL to create sequences. fa487b6
Padraig O'Sullivan Akiban does not need to implement function for returning now expressi…
…on. This is due to Akiban having a NOW() function that is compatible with MySQL.
025fd93
Padraig O'Sullivan Akiban does not support regular expressions at this time. ad5cd9f
Padraig O'Sullivan Implement getLocateExpression function. 74ff267
Padraig O'Sullivan Implement getDateDiffExpression function. 9e5af6b
Padraig O'Sullivan Implement getDateAddDaysExpression function. 227f159
Padraig O'Sullivan Implement getDateSubDaysExpression function. 4f25bd2
Padraig O'Sullivan Implement getDateAddMonthExpression function. b2141df
Padraig O'Sullivan Implement getDateSubMonthExpression function. 6c97818
Padraig O'Sullivan Implement getListTablesSQL function. 2fcc4c9
Padraig O'Sullivan Implement getListViewsSQL function. db4e494
Padraig O'Sullivan Implement getCreateViewSQL function. ed04fa2
Padraig O'Sullivan Implement getListDatabasesSQL function. 87c0974
Padraig O'Sullivan Add cascade to drop schema command. This ensures a schema is dropped …
…even if it contains tables.
755a2d4
Padraig O'Sullivan Akiban does not support ALTER SEQUENCE yet so throw an unsupported ex…
…ception when that function is called.
85e5f1c
Padraig O'Sullivan Implement getSchemaNames function. 1e96fff
Padraig O'Sullivan Implement dropDatabase function. cc50f53
Padraig O'Sullivan Implement createDatabase function. 4c8020b
Padraig O'Sullivan Add parameter checking to dropDatabase function. d4166e9
Padraig O'Sullivan Use functions from abstract class for trigger related functionality. d4003ab
Padraig O'Sullivan Copy implementation of _getPortableViewDefintion from PostgreSQL impl…
…ementation.
47b70ae
Padraig O'Sullivan Use PostgreSQL implementation of _getPortableUserDefinition function. 010cb79
Padraig O'Sullivan Implement _getPortableTableDefinition table. 8b547df
Padraig O'Sullivan Implement _getPortableDatabaseDefinition function. 240afe1
Padraig O'Sullivan Implement _getPortableSequenceDefintion function. d05326b
Padraig O'Sullivan Use copy of PostgreSQL keywords for Akiban Server keywords for now. 8259c93
Padraig O'Sullivan Akiban Server will not implement _getPortableTableForeignKeyDefinitio…
…n for now.
660dee4
Padraig O'Sullivan Implement getSubstringExpression function. 52c882f
Padraig O'Sullivan Simple implementation of getListTableIndexesSQL function. Not sure if…
… this is sufficient.
8703c4c
Padraig O'Sullivan Implement initializeDoctrineTypeMappings function. This function has …
…the current types Akiban Server supports. As Akiban Server supports more types, this function will need to be updated.
8fde2b7
Padraig O'Sullivan Implemented the getTimeTypeDeclarationSQL function. 81123e0
Padraig O'Sullivan Implement getDateTimeTypeDeclaration function. Taken from MySQL imple…
…mentation for now.
6d58a7a
Padraig O'Sullivan Implement getBooleanTypeDeclarationSQL function. 63889e3
Padraig O'Sullivan Implement getListSequencesSQL function. 269f118
Padraig O'Sullivan Throw unsupported operation exception if an attempt is made to change…
… transaction isolation level for a session.
32961fa
Padraig O'Sullivan No need for akiban server to implement convertBooleans function. 682e207
Padraig O'Sullivan Implement getAlterTableSQL function. 1ed0377
Padraig O'Sullivan Akbian Server does not have date or time data types that support time…
…zones (same as mysql).
05fed4d
Padraig O'Sullivan Implement initial version of _getCreateTableSQL function. b40d8bb
Padraig O'Sullivan use default implementation of getDropForeignKeySQL for Akiban. 541fb29
Padraig O'Sullivan Use default implementation for getAdvancedForeignKeyOptionsSQL function. 4c7c94a
Padraig O'Sullivan Akiban Server does not need getTableWhereClause function. 1df2d9a
Padraig O'Sullivan Implemenet getListTableColumnsSQL function. 1736d59
Padraig O'Sullivan Implemnet getListTableConstraintsSQL function. 3277021
Padraig O'Sullivan Throw un-supported operation exception for getListTableForeignKeysSQL…
… function in Akiban for now.
556273f
Padraig O'Sullivan Unit tests can now run against Akiban with most of them obviously fai…
…ling right now since we have not implemented the majority of functionality.
a9513da
Padraig O'Sullivan Explicitly specify Akiban does not support savepoints. Flesh out a fe…
…w methods in Connection and Statement classes so queries can be sent to Akiban now. This allows basic unit tests to pass. Will likely modify this implementation in the near future.
e8d0f49
Padraig O'Sullivan Implement transaction related methods in AkibanSrvConnection class. 68dc30d
Padraig O'Sullivan Implement columnCount function in AkibanSrvStatement class. 44bbb0f
Padraig O'Sullivan Specify how Akiban does bit and/or operationsin platform class. 180666e
Padraig O'Sullivan Modification to unit test that takes Akiban behavior into account. 31b9f20
Padraig O'Sullivan Implement quote method in AkibanSrvConnection class. Implementation i…
…s taken from OCI8 driver.
f18ef46
Padraig O'Sullivan Implement remaining methods in AkibanSrvStatement class. 490f1f4
Padraig O'Sullivan Corrections to test around fetch with classes. 499ba2d
Padraig O'Sullivan Got more unit tests to pass. Failing tests are now related to serial …
…data type not being supported at the moment. AkibanSrvStatement class needs to be cleaned up a little bit.
ccc65fb
Padraig O'Sullivan Use identity columns for auto-increment for now until support for ser…
…ial is added.
578ce0a
Padraig O'Sullivan Akiban does not support the FOR UPDATE clause at the moment. a48684c
Padraig O'Sullivan Akiban does not support nested transactions at the moment so only beg…
…in a new transaction if not already in a transaction.
3d4668f
Padraig O'Sullivan If running unit tests against Akiban, do not run tests related to tem…
…porary tables since Akiban does not support those.
200ebd8
Padraig O'Sullivan Get all required information about a sequence from the information_sc…
…hema.
15e3204
Padraig O'Sullivan Re-enable failing test. f737f40
Padraig O'Sullivan Implement lastInsertId function in AkibanSrvConnection now that currv…
…al support has been added to Akiban.
366ad07
Padraig O'Sullivan Use serial instead of identity columns since akiban now supports it. 40fe291
Padraig O'Sullivan Clear up exception message. ef8ba00
Padraig O'Sullivan Make some formatting of comments more consistent. 50e8ce0
Padraig O'Sullivan Remove un-needed variable in AkibanSrvStatement class. af2cc93
Padraig O'Sullivan Simplify code in AkibanSrvStatement class. 0eef622
Padraig O'Sullivan Clean up code in AkibanSrvStatement class around fetching of results. 1aa8278
Padraig O'Sullivan Be more consistent with string quoting. f276c65
Padraig O'Sullivan Implement getUniqueConstraintDeclarationSQL function. 4cf1dee
Padraig O'Sullivan Akiban does not support foreign key constraints. Explicitly specify t…
…hat in platform implementation.
2044afb
Padraig O'Sullivan Implement some of the remaining functions in Platform and Schema mana…
…ger.
a0cea52
Padraig O'Sullivan Add test for AkibanSchemaManager. 8931cf1
Padraig O'Sullivan Add tests for AkibanServerPlatform class. 390d5a9
Padraig O'Sullivan Expand on comments so it is clear what akiban does/does not support. ab0a456
Padraig O'Sullivan Correct unit tests around akiban platform class. f7b0275
Padraig O'Sullivan Revert unit tests back to way they used to be. 316ee6d
Padraig O'Sullivan Changed a unit test by accident. 116640e
Padraig O'Sullivan Akiban does not support savepoints so make sure test reflects that. f1dab8e
Don't Add Me To Your Organization a.k.a The Travis Bot

This pull request passes (merged f1dab8e into e25c774).

Don't Add Me To Your Organization a.k.a The Travis Bot

This pull request passes (merged f1dab8e into e25c774).

lib/Doctrine/DBAL/Driver/AkibanSrv/AkibanSrvConnection.php
... ...
@@ -0,0 +1,179 @@
  1
+<?php
  2
+/*
  3
+ *  $Id$
1
Christophe Coevoet
stof added a note August 24, 2012

Please remove this. We have some files which still have it, but it is a left-over from the SVN area

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/Doctrine/DBAL/Driver/AkibanSrv/AkibanSrvConnection.php
((15 lines not shown))
  15
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  16
+ *
  17
+ * This software consists of voluntary contributions made by many individuals
  18
+ * and is licensed under the MIT license. For more information, see
  19
+ * <http://www.doctrine-project.org>.
  20
+ */
  21
+
  22
+namespace Doctrine\DBAL\Driver\AkibanSrv;
  23
+
  24
+use Doctrine\DBAL\Platforms\AkibanServerPlatform;
  25
+
  26
+/**
  27
+ * Akiban Server implementation of the Connection interface.
  28
+ *
  29
+ * @author Padraig O'Sullivan <osullivan.padraig@gmail.com>
  30
+ * @since  2.3
1
Christophe Coevoet
stof added a note August 24, 2012

this should be 2.4 as 2.3 is already in RC and so new features cannot be added in it anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/Doctrine/DBAL/Driver/AkibanSrv/AkibanSrvConnection.php
((22 lines not shown))
  22
+namespace Doctrine\DBAL\Driver\AkibanSrv;
  23
+
  24
+use Doctrine\DBAL\Platforms\AkibanServerPlatform;
  25
+
  26
+/**
  27
+ * Akiban Server implementation of the Connection interface.
  28
+ *
  29
+ * @author Padraig O'Sullivan <osullivan.padraig@gmail.com>
  30
+ * @since  2.3
  31
+ */
  32
+class AkibanSrvConnection implements \Doctrine\DBAL\Driver\Connection
  33
+{
  34
+    /**
  35
+     * @var resource
  36
+     */
  37
+    protected $_dbh;
1
Christophe Coevoet
stof added a note August 24, 2012

please remove the underscore. This naming convention comes from the PHP 4 time when there was no visibility in PHP (everything was puoblic), and Doctrine does not use it anymore for new code (and older code using it is renamed little by little)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/Doctrine/DBAL/Driver/AkibanSrv/AkibanSrvConnection.php
((30 lines not shown))
  30
+ * @since  2.3
  31
+ */
  32
+class AkibanSrvConnection implements \Doctrine\DBAL\Driver\Connection
  33
+{
  34
+    /**
  35
+     * @var resource
  36
+     */
  37
+    protected $_dbh;
  38
+
  39
+    /**
  40
+     * Create a Connection to an Akiban Server Database using 
  41
+     * the native PostgreSQL PHP driver.
  42
+     *
  43
+     * @param string $username
  44
+     * @param string $password
  45
+     * @param string $schema
1
Christophe Coevoet
stof added a note August 24, 2012

this looks out of sync :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/Doctrine/DBAL/Driver/AkibanSrv/AkibanSrvConnection.php
((73 lines not shown))
  73
+    {
  74
+        $args = func_get_args();
  75
+        $sql = $args[0];
  76
+        $stmt = $this->prepare($sql);
  77
+        $stmt->execute();
  78
+        return $stmt;
  79
+    }
  80
+
  81
+    /**
  82
+     * Quote input value.
  83
+     *
  84
+     * @param mixed $input
  85
+     * @param int $type PDO::PARAM*
  86
+     * @return mixed
  87
+     */
  88
+    public function quote($value, $type=\PDO::PARAM_STR)
1
Christophe Coevoet
stof added a note August 24, 2012

you should add spaces around the = in the signature (same for all methods)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/Doctrine/DBAL/Driver/AkibanSrv/AkibanSrvConnection.php
((117 lines not shown))
  117
+
  118
+        $sql = "SELECT CURRENT VALUE FOR " . $name;
  119
+        $stmt = $this->query($sql);
  120
+        $result = $stmt->fetchColumn(0);
  121
+
  122
+        if ($result === false) {
  123
+            throw new AkibanSrvException("lastInsertId failed due to current value not being returned for a sequence.");
  124
+        }
  125
+        return (int) $result[0];
  126
+    }
  127
+
  128
+    /**
  129
+     * Start a transactiom
  130
+     *
  131
+     * @return bool
  132
+     */
1
Christophe Coevoet
stof added a note August 24, 2012

please use {@inheritDoc} for all methods already documented in the parent class or the interface (eventually adding something if there is a need for an explanation about the way it is implemented). It makes it easier to maintain than duplicating the phpdoc (we don't need to fix typos in 10 different places)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/Doctrine/DBAL/Driver/AkibanSrv/AkibanSrvConnection.php
((122 lines not shown))
  122
+        if ($result === false) {
  123
+            throw new AkibanSrvException("lastInsertId failed due to current value not being returned for a sequence.");
  124
+        }
  125
+        return (int) $result[0];
  126
+    }
  127
+
  128
+    /**
  129
+     * Start a transactiom
  130
+     *
  131
+     * @return bool
  132
+     */
  133
+    public function beginTransaction()
  134
+    {
  135
+        $trxStatus = pg_transaction_status($this->_dbh);
  136
+        if (! $trxStatus == PGSQL_TRANSACTION_INTRANS) {
  137
+            if (! pg_query($this->_dbh, "BEGIN")) {
1
Christophe Coevoet
stof added a note August 24, 2012

you should use && here instead of nesting 2 if

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/Doctrine/DBAL/Driver/AkibanSrv/AkibanSrvStatement.php
((59 lines not shown))
  59
+
  60
+    /**
  61
+     * An array of the parameters for this statement.
  62
+     */
  63
+    private $_parameters = array();
  64
+
  65
+    /**
  66
+     * The fetch mode for this statement.
  67
+     */
  68
+    private $_defaultFetchMode = PDO::FETCH_BOTH;
  69
+
  70
+    private $_className;
  71
+    private $_ctorArgs;
  72
+
  73
+    private static $fetchModeMap = 
  74
+      array(
1
Christophe Coevoet
stof added a note August 24, 2012

array( should be on the previous line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/Doctrine/DBAL/Driver/AkibanSrv/AkibanSrvStatement.php
((56 lines not shown))
  56
+     * @var resource
  57
+     */
  58
+    private $_conn;
  59
+
  60
+    /**
  61
+     * An array of the parameters for this statement.
  62
+     */
  63
+    private $_parameters = array();
  64
+
  65
+    /**
  66
+     * The fetch mode for this statement.
  67
+     */
  68
+    private $_defaultFetchMode = PDO::FETCH_BOTH;
  69
+
  70
+    private $_className;
  71
+    private $_ctorArgs;
1
Christophe Coevoet
stof added a note August 24, 2012

Please don't abbreviate the name. It will be more readable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/Doctrine/DBAL/Driver/AkibanSrv/AkibanSrvStatement.php
((188 lines not shown))
  188
+            $this->_results = pg_query($this->_dbh, $this->_statement);
  189
+        } else if (empty($this->_parameters) && ! is_null($params)) {
  190
+            $this->_results = pg_query_params($this->_dbh, $this->_statement, $params);
  191
+        } else {
  192
+            $this->_results = pg_query_params($this->_dbh, $this->_statement, $this->_parameters);
  193
+        }
  194
+        return $this->_results;
  195
+    }
  196
+
  197
+    /**
  198
+     * {@inheritdoc}
  199
+     */
  200
+    public function setFetchMode($fetchMode, $arg2 = null, $arg3 = null)
  201
+    {
  202
+        $this->_defaultFetchMode = $fetchMode;
  203
+        if ($fetchMode == PDO::FETCH_OBJ || $fetchMode == PDO::FETCH_CLASS) {
1
Christophe Coevoet
stof added a note August 24, 2012

Please use a strict comparison whenever possible. And You should use && instead of a nested if

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/Doctrine/DBAL/Driver/AkibanSrv/AkibanSrvStatement.php
((203 lines not shown))
  203
+        if ($fetchMode == PDO::FETCH_OBJ || $fetchMode == PDO::FETCH_CLASS) {
  204
+            if (func_num_args() >= 2) {
  205
+                $args = func_get_args();
  206
+                $this->_className = $args[1];
  207
+                $this->_ctorArgs = (isset($args[2])) ? $args[2] : array();
  208
+            }
  209
+        }
  210
+    }
  211
+
  212
+    /**
  213
+     * {@inheritdoc}
  214
+     */
  215
+    public function getIterator()
  216
+    {
  217
+        $data = $this->fetchAll();
  218
+        return new \ArrayIterator($data);
1
Christophe Coevoet
stof added a note August 24, 2012

you don't need $data IMO. It could be inlined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/Doctrine/DBAL/Driver/AkibanSrv/AkibanSrvStatement.php
((221 lines not shown))
  221
+    /**
  222
+     * {@inheritdoc}
  223
+     */
  224
+    public function fetch($fetchMode = null, $rowPos = NULL)
  225
+    {
  226
+        $fetchMode = $fetchMode ? : $this->_defaultFetchMode;
  227
+
  228
+        if (! isset(self::$fetchModeMap[$fetchMode])) {
  229
+            throw new \InvalidArgumentException("Invalid fetch style: " . $fetchMode);
  230
+        }
  231
+
  232
+        if ($fetchMode == PDO::FETCH_OBJ || $fetchMode == PDO::FETCH_CLASS) {
  233
+            if ($this->_results && $this->_className) {
  234
+                if (empty($this->_ctorArgs)) {
  235
+                    return pg_fetch_object($this->_results, $rowPos, $this->_className);
  236
+                } else {
1
Christophe Coevoet
stof added a note August 24, 2012

no need to use else as the if returns:

<?php

if ($this->_results && $this->_className) {
    return;
}

// some code executed only when the condition is false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/Doctrine/DBAL/Driver/AkibanSrv/AkibanSrvStatement.php
((249 lines not shown))
  249
+    /**
  250
+     * {@inheritdoc}
  251
+     */
  252
+    public function fetchAll($fetchMode = null)
  253
+    {
  254
+        $fetchMode = $fetchMode ? : $this->_defaultFetchMode;
  255
+
  256
+        if (! isset(self::$fetchModeMap[$fetchMode])) {
  257
+            throw new \InvalidArgumentException("Invalid fetch mode: " . $fetchMode);
  258
+        }
  259
+
  260
+        $result = array();
  261
+
  262
+        switch ($fetchMode) {
  263
+        case PDO::FETCH_OBJ:
  264
+        case PDO::FETCH_CLASS:
1
Christophe Coevoet
stof added a note August 24, 2012

missing one indentation level here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/Doctrine/DBAL/Driver/AkibanSrv/Driver.php
((41 lines not shown))
  41
+        if (isset($params['dbname'])) {
  42
+            $connString .= 'dbname=' . $params['dbname'] . ' ';
  43
+        }
  44
+        if (isset($username)) {
  45
+            $connString .= 'user=' . $username . ' ';
  46
+        }
  47
+        if (isset($password)) {
  48
+            $connString .= 'user=' . $username . ' ';
  49
+        }
  50
+
  51
+        return $connString;
  52
+    }
  53
+
  54
+    public function getDatabasePlatform()
  55
+    {
  56
+        return new \Doctrine\DBAL\Platforms\AkibanServerPlatform();
1
Christophe Coevoet
stof added a note August 24, 2012

you should add use statements for these classes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/Doctrine/DBAL/Platforms/AkibanServerPlatform.php
((46 lines not shown))
  46
+    {
  47
+        if ($len === null) {
  48
+            return "SUBSTR(" . $value . ", " . $from . ")";
  49
+        } else {
  50
+            return "SUBSTR(" . $value . ", " . $from . ", " . $len . ")";
  51
+        }
  52
+    }
  53
+
  54
+    /**
  55
+     * returns the position of the first occurrence of substring $substr in string $str
  56
+     *
  57
+     * @param string $substr    literal string to find
  58
+     * @param string $str       literal string
  59
+     * @param int    $pos       position to start at, beginning of string by default
  60
+     * @return integer
  61
+     */
1
Christophe Coevoet
stof added a note August 24, 2012

Please use inheritDoc whenever possible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/Doctrine/DBAL/Platforms/AkibanServerPlatform.php
((34 lines not shown))
  34
+    /**
  35
+     * Returns part of a string.
  36
+     *
  37
+     * Note: Not SQL92, but common functionality.
  38
+     *
  39
+     * @param string $value the target $value the string or the string column.
  40
+     * @param int $from extract from this character.
  41
+     * @param int $len extract this amount of characters.
  42
+     * @return string sql that extracts part of a string.
  43
+     * @override
  44
+     */
  45
+    public function getSubstringExpression($value, $from, $len = null)
  46
+    {
  47
+        if ($len === null) {
  48
+            return "SUBSTR(" . $value . ", " . $from . ")";
  49
+        } else {
1
Christophe Coevoet
stof added a note August 24, 2012

please don't use else when it is not needed (see the other platforms as I fixed their coding standards 2 weeks ago)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/Doctrine/DBAL/Platforms/AkibanServerPlatform.php
((242 lines not shown))
  242
+    public function getListTableConstraintsSQL($table)
  243
+    {
  244
+        // TODO - do we only want unique and primary key indexes here?
  245
+        return "SELECT index_name " .
  246
+               "FROM information_schema.indexes " .
  247
+               "WHERE schema_name != 'information_schema' AND " .
  248
+               "table_name = '" . $table . "'";
  249
+    }
  250
+
  251
+    /**
  252
+     * @param  string $table
  253
+     * @return string
  254
+     */
  255
+    public function getListTableIndexesSQL($table, $currentDatabase = null)
  256
+    {
  257
+        if (! is_null($currentDatabase)) {
1
Christophe Coevoet
stof added a note August 24, 2012

please use null !== to compare the value with null, to be consistent with our coing standards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/Doctrine/DBAL/Schema/AkibanServerSchemaManager.php
((94 lines not shown))
  94
+    }
  95
+
  96
+    protected function _getPortableTableDefinition($table)
  97
+    {
  98
+        return $table['table_name'];
  99
+    }
  100
+
  101
+    /**
  102
+     * @param  array $tableIndexes
  103
+     * @param  string $tableName
  104
+     * @return array
  105
+     */
  106
+    protected function _getPortableTableIndexesList($tableIndexes, $tableName=null)
  107
+    {
  108
+        $indexBuffer = array();
  109
+        if (! empty($tableIndexes)) {
1
Christophe Coevoet
stof added a note August 24, 2012

is it really needed ? Looping over an empty array is possible without any issue (I simply haven't checked the code to be sire that the array is always passed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/Doctrine/DBAL/Driver/AkibanSrv/AkibanSrvStatement.php
((275 lines not shown))
  275
+        case PDO::FETCH_NUM:
  276
+            $result = $this->fetchRows($fetchMode);
  277
+            break;
  278
+        case PDO::FETCH_COLUMN:
  279
+            for ($i = 0; $i < pg_num_rows($this->_results); $i++) {
  280
+                for ($col = 0; $col < $this->columnCount(); $col++) {
  281
+                    $result[] = $this->fetchColumn($col, $i);
  282
+                }
  283
+            }
  284
+            break;
  285
+        default:
  286
+            $result = pg_fetch_all($this->_results);
  287
+            break;
  288
+        }
  289
+
  290
+        return empty($result) ? false : $result;
1
Christophe Coevoet
stof added a note August 24, 2012

this does not respect the interface. It mandates to return an array in fetchAll. Why replacing an empty array by false ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
tests/Doctrine/Tests/DBAL/Functional/DataAccessTest.php
@@ -338,7 +338,7 @@ public function testQuoteSQLInjection()
338 338
         $sql = "SELECT * FROM fetch_table WHERE test_string = " . $this->_conn->quote("bar' OR '1'='1");
339 339
         $rows = $this->_conn->fetchAll($sql);
340 340
 
341  
-        $this->assertEquals(0, count($rows), "no result should be returned, otherwise SQL injection is possible");
  341
+        $this->assertEquals(0, ($rows == false) ? 0 : count($rows), "no result should be returned, otherwise SQL injection is possible");
1
Christophe Coevoet
stof added a note August 24, 2012

please revert it. It should not be necessary if fetchAll was implemented as expected by the interface

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
tests/Doctrine/Tests/DBAL/Functional/Schema/AkibanSrvSchemaManagerTest.php
((14 lines not shown))
  14
+    {
  15
+        parent::tearDown();
  16
+
  17
+        if (!$this->_conn) {
  18
+            return;
  19
+        }
  20
+
  21
+        $this->_conn->getConfiguration()->setFilterSchemaAssetsExpression(null);
  22
+    }
  23
+
  24
+    public function testGetSchemaNames()
  25
+    {
  26
+        $names = $this->_sm->getSchemaNames();
  27
+
  28
+        $this->assertInternalType('array', $names);
  29
+        $this->assertTrue(count($names) > 0);
1
Christophe Coevoet
stof added a note August 24, 2012

you should use assertGreaterThan so that the message is better in case of failure (currently, it would say Failed asserting false is true)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
tests/Doctrine/Tests/DBAL/Functional/WriteTest.php
@@ -122,7 +122,8 @@ public function testDelete()
122 122
         $this->assertEquals(1, count($this->_conn->fetchAll('SELECT * FROM write_table')));
123 123
 
124 124
         $this->assertEquals(1, $this->_conn->delete('write_table', array('test_int' => 1)));
125  
-        $this->assertEquals(0, count($this->_conn->fetchAll('SELECT * FROM write_table')));
  125
+        $result = $this->_conn->fetchAll('SELECT * FROM write_table');
  126
+        $this->assertEquals(0, ($result == false) ? 0 : count($result));
1
Christophe Coevoet
stof added a note August 24, 2012

same here than above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Christophe Coevoet
stof commented August 24, 2012

Hi,

If you are willing to continue maintaining this driver, there is definitely a good chance to have it merged once it is ready (my comments are about letting you achieve this goal).
And a pull request is the best way to do it as you already have some code for it. It is the best way to let us review it.

Benjamin Eberlei
Owner

Hi,

thank you for this contribution. We will consider including it as a third-party maintained driver, but we have to put the full maintenance and testing of it into your hands. That means we mention the driver on the documentation and link to you for support. Tickets can go through our jira and we can make you a developer on Jira.

Padraig O'Sullivan

First off, a huge thank you for the review and very helpful comments. I will go through those today and apply your suggestions.

One question I did have: is there an official coding standards doc somewhere I can use for reference?

As for maintenance, I am very willing to maintain, test, support, and continue to improve this driver.

Christophe Coevoet
stof commented August 24, 2012

The official coding standards are mostly the PSR-2 standard. And then on top of that, @guilhermeblanco enforces some rules coming from the Object Calisthenics (but he checks the ORM more than DBAL IIRC)

Don't Add Me To Your Organization a.k.a The Travis Bot

This pull request passes (merged abb7b55 into e25c774).

Don't Add Me To Your Organization a.k.a The Travis Bot

This pull request passes (merged 6003fae into e25c774).

Padraig O'Sullivan

Ok, this branch is ready for another review.

I've updated the code to adhere to the coding standards and applied the suggestions you specified.

lib/Doctrine/DBAL/Driver/AkibanSrv/AkibanSrvStatement.php
((41 lines not shown))
  41
+    /**
  42
+     * SQL statement to execute
  43
+     *
  44
+     * @var string
  45
+     */
  46
+    private $statement;
  47
+
  48
+    /**
  49
+     * query results
  50
+     */
  51
+    private $results;
  52
+
  53
+    /**
  54
+     * Akiban Server connection object.
  55
+     *
  56
+     * @var resource
1
Christophe Coevoet
stof added a note August 24, 2012

wrong phpdoc. This is not a resource

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/Doctrine/DBAL/Driver/AkibanSrv/AkibanSrvStatement.php
((43 lines not shown))
  43
+     *
  44
+     * @var string
  45
+     */
  46
+    private $statement;
  47
+
  48
+    /**
  49
+     * query results
  50
+     */
  51
+    private $results;
  52
+
  53
+    /**
  54
+     * Akiban Server connection object.
  55
+     *
  56
+     * @var resource
  57
+     */
  58
+    private $connection;
2
Christophe Coevoet
stof added a note August 24, 2012

Btw, I asked to avoid to avoid abbreviating constructorArguments to cstorArgs to keep it readable, but conn is used in the whole Doctrine codebase each time a connection is stored in a variable (both DBAL and ORM) so I would vote for keeping it in this cases (same for params, which may even be used in method names IIRC)

Padraig O'Sullivan
posulliv added a note August 25, 2012

Makes sense to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Christophe Coevoet stof commented on the diff August 24, 2012
lib/Doctrine/DBAL/Driver/AkibanSrv/AkibanSrvStatement.php
((98 lines not shown))
  98
+     * this method converts all positional parameters into numbered parameters.
  99
+     */
  100
+    private function convertPositionalToNumberedParameters($statement)
  101
+    {
  102
+        $count = 1;
  103
+        $inLiteral = false;
  104
+        $stmtLen = strlen($statement);
  105
+        for ($i = 0; $i < $stmtLen; $i++) {
  106
+            if ($statement[$i] === '?' && ! $inLiteral) {
  107
+                $param = "$" . $count;
  108
+                $len = strlen($param);
  109
+                $statement = substr_replace($statement, $param, $i, 1);
  110
+                $i += $len - 1;
  111
+                $stmtLen = strlen($statement);
  112
+                ++$count;
  113
+            } else if ($statement[$i] === "'" || $statement[$i] === '"') {
2
Christophe Coevoet
stof added a note August 24, 2012

This breaks if you have the string "Foo'Bar" in the query, as the single quote in the literal will trigger a switch whereas only the double quote should end the literal. You need some more complex logic

Padraig O'Sullivan
posulliv added a note August 25, 2012

Indeed, right you are. Another benefit of modifying our implementation to using the PostgreSQL PDO driver would be we could get rid of the need for this method entirely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/Doctrine/DBAL/Driver/AkibanSrv/AkibanSrvStatement.php
((177 lines not shown))
  177
+
  178
+    /**
  179
+     * {@inheritDoc}
  180
+     */
  181
+    public function errorInfo()
  182
+    {
  183
+        return pg_last_error($this->connectionHandle);
  184
+    }
  185
+
  186
+    /**
  187
+     * {@inheritdoc}
  188
+     */
  189
+    public function execute($params = null)
  190
+    {
  191
+        $noExistingParameters = empty($this->parameters) ? true : false;
  192
+        $parametersPassed = null !== $params ? true : false;
1
Christophe Coevoet
stof added a note August 24, 2012

no need for these ternary operators: empty returns a boolean, and so does the comparison.

thus, you can get rid of these variable entirely:

<?php
if ( ! empty($this->parameters)) {
    return $this->executeParameterizedQuery($this->connectionHandle, $this->statement, $this->parameters);
}

if (null !== $params) {
    return $this->executeParameterizedQuery($this->connectionHandle, $this->statement, $params);
}

return $this->executeQuery($this->connectionHandle, $this->statement);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/Doctrine/DBAL/Driver/AkibanSrv/AkibanSrvStatement.php
((189 lines not shown))
  189
+    public function execute($params = null)
  190
+    {
  191
+        $noExistingParameters = empty($this->parameters) ? true : false;
  192
+        $parametersPassed = null !== $params ? true : false;
  193
+        if ($noExistingParameters && ! $parametersPassed) {
  194
+            return $this->executeQuery($this->connectionHandle, $this->statement);
  195
+        }
  196
+        if ($noExistingParameters && $parametersPassed) {
  197
+            return $this->executeParameterizedQuery($this->connectionHandle, $this->statement, $params);
  198
+        }
  199
+        return $this->executeParameterizedQuery($this->connectionHandle, $this->statement, $this->parameters);
  200
+    }
  201
+
  202
+    private function executeParameterizedQuery($connectionHandle, $statement, $parameters)
  203
+    {
  204
+        $this->results = pg_query_params($connectionHandle, $statement, $parameters);
1
Christophe Coevoet
stof added a note August 24, 2012

you could simplify the signature by accessing $this->connectionHandle here directly instead of passing it as an argument from the calling code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/Doctrine/DBAL/Driver/AkibanSrv/AkibanSrvStatement.php
((227 lines not shown))
  227
+    }
  228
+
  229
+    /**
  230
+     * {@inheritdoc}
  231
+     */
  232
+    public function getIterator()
  233
+    {
  234
+        return new \ArrayIterator($this->fetchAll());
  235
+    }
  236
+
  237
+    /**
  238
+     * {@inheritdoc}
  239
+     */
  240
+    public function fetch($fetchMode = null, $rowPos = null)
  241
+    {
  242
+        $fetchMode = $fetchMode ? : $this->defaultFetchMode;
1
Christophe Coevoet
stof added a note August 24, 2012

the space should be removed when using the short version of the ternary operator: ?:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Christophe Coevoet stof commented on the diff August 24, 2012
lib/Doctrine/DBAL/Driver/AkibanSrv/AkibanSrvStatement.php
((290 lines not shown))
  290
+                        $result[] = $this->fetchColumn($col, $i);
  291
+                    }
  292
+                }
  293
+                break;
  294
+            default:
  295
+                $result = pg_fetch_all($this->results);
  296
+                break;
  297
+        }
  298
+
  299
+        /*
  300
+         * The native PostgreSQL client returns false if no
  301
+         * rows are returned. Since the fetchAll interface
  302
+         * specifies an array must be returned, make sure
  303
+         * an empty array is returned if in fact the PostgreSQL
  304
+         * client returned false.
  305
+         */
3
Christophe Coevoet
stof added a note August 24, 2012

Reading the php.net documentation, it looks like false is meant to be returned in case of an error too, meaning it does not allow any error reporting if we consider that a query returning 0 results may be a valid use case (which it is).

So now, I'm wondering why you guys choosed to use the pg_* functions to connect to your system, given their poor API. Would it work to use the PDO PosgreSQL driver instead ?

Padraig O'Sullivan
posulliv added a note August 25, 2012

It is possible to use the PDO driver but there is PostgreSQL functionality that the PDO driver uses which Akiban does not support.

For example, the DEALLOCATE statement is used to free prepared statements (relevant source).

Another example of something we don't support is server-side cursors. These are used in a few places by the PDO driver.

That said, it might still be beneficial to see how far I could get using the PDO driver. What I might do is get this branch cleaned up with all your feedback applied and once that is done, try creating another implementation that uses PDO instead of pg_* and see how far I can get.

Christophe Coevoet
stof added a note August 25, 2012

yeah, this sounds like a plan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/Doctrine/DBAL/Driver/AkibanSrv/Driver.php
((36 lines not shown))
  36
+    public function connect(array $params, $username = null, $password = null, array $driverOptions = array())
  37
+    {
  38
+        return new AkibanSrvConnection(
  39
+            $this->constructConnectionString($params, $username, $password)
  40
+        );
  41
+    }
  42
+
  43
+    /**
  44
+     * Constructs the Akiban Server connection string.
  45
+     *
  46
+     * @return string The connection string.
  47
+     */
  48
+    private function constructConnectionString(array $params, $username, $password)
  49
+    {
  50
+        $connString = '';
  51
+        if (isset($params['host']) && $params['host'] !== '') {
1
Christophe Coevoet
stof added a note August 24, 2012

I would simply use ``if ( ! empty($params['host'])) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/Doctrine/DBAL/Driver/AkibanSrv/Driver.php
((66 lines not shown))
  66
+
  67
+        return $connString;
  68
+    }
  69
+
  70
+    /**
  71
+     * {@inheritDoc}
  72
+     */
  73
+    public function getDatabasePlatform()
  74
+    {
  75
+        return new AkibanServerPlatform();
  76
+    }
  77
+
  78
+    /**
  79
+     * {@inheritDoc}
  80
+     */
  81
+    public function getSchemaManager(\Doctrine\DBAL\Connection $conn)
1
Christophe Coevoet
stof added a note August 24, 2012

please add a use statement for this class please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/Doctrine/DBAL/Platforms/AkibanServerPlatform.php
((175 lines not shown))
  175
+    }
  176
+
  177
+    /**
  178
+     * {@inheritdoc}
  179
+     */
  180
+    public function supportsForeignKeyConstraints()
  181
+    {    
  182
+        return false;
  183
+    }    
  184
+
  185
+    /**
  186
+     * {@inheritdoc}
  187
+     */
  188
+    public function supportsForeignKeyOnUpdate()
  189
+    {    
  190
+        return ($this->supportsForeignKeyConstraints() && true);
1
Christophe Coevoet
stof added a note August 24, 2012

I would remove the && true here. It is useless (even if I recognize it is a copy-paste from some other code) :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Christophe Coevoet stof commented on the diff August 24, 2012
lib/Doctrine/DBAL/Platforms/AkibanServerPlatform.php
((235 lines not shown))
  235
+    }
  236
+
  237
+    /**
  238
+     * {@inheritdoc}
  239
+     */
  240
+    public function getDropViewSQL($name)
  241
+    {
  242
+        return "DROP VIEW " . $name;
  243
+    }
  244
+
  245
+    /**
  246
+     * {@inheritdoc}
  247
+     */
  248
+    public function getListTableConstraintsSQL($table)
  249
+    {
  250
+        // TODO - do we only want unique and primary key indexes here?
2
Christophe Coevoet
stof added a note August 24, 2012

@beberlei what is expected exactly here ?

Padraig O'Sullivan
posulliv added a note August 25, 2012

Yes, I was a little unsure of what to return here.

The different driver implementations seem to be inconsistent here. The MySQL and SQL Server drivers returns the list of indexes on a table while the Oracle driver returns all constraints on the table including check and foreign key constraints. The PostgreSQL driver seems to only return unique and primary key indexes on the table

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Christophe Coevoet stof commented on the diff August 24, 2012
lib/Doctrine/DBAL/Schema/AkibanServerSchemaManager.php
((41 lines not shown))
  41
+
  42
+    /**
  43
+     * {@inheritdoc}
  44
+     */
  45
+    public function dropDatabase($database = null)
  46
+    {
  47
+        if (null === $database) {
  48
+            $database = $this->_conn->getDatabase();
  49
+        }
  50
+
  51
+        $params = $this->_conn->getParams();
  52
+        $params["dbname"] = "information_schema";
  53
+        $tmpPlatform = $this->_platform;
  54
+        $tmpConn = $this->_conn;
  55
+
  56
+        $this->_conn = \Doctrine\DBAL\DriverManager::getConnection($params);
1
Christophe Coevoet
stof added a note August 24, 2012

please add a use statement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/Doctrine/DBAL/Schema/AkibanServerSchemaManager.php
((193 lines not shown))
  193
+            case 'double precision':
  194
+            case 'real':
  195
+            case 'decimal':
  196
+            case 'numeric':
  197
+                // TODO
  198
+                break;
  199
+            case 'year':
  200
+                $length = null;
  201
+                break;
  202
+        }
  203
+
  204
+        if ($tableColumn['default'] && preg_match("('([^']+)'::)", $tableColumn['default'], $match)) {
  205
+            $tableColumn['default'] = $match[1];
  206
+        }
  207
+
  208
+        $tableColumn['nullable'] == 'NO' ? $notnull = true : $notnull = false;
1
Christophe Coevoet
stof added a note August 24, 2012

please write it as $notNull = $tableColumn['nullable'] === 'NO'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/Doctrine/DBAL/Schema/AkibanServerSchemaManager.php
((194 lines not shown))
  194
+            case 'real':
  195
+            case 'decimal':
  196
+            case 'numeric':
  197
+                // TODO
  198
+                break;
  199
+            case 'year':
  200
+                $length = null;
  201
+                break;
  202
+        }
  203
+
  204
+        if ($tableColumn['default'] && preg_match("('([^']+)'::)", $tableColumn['default'], $match)) {
  205
+            $tableColumn['default'] = $match[1];
  206
+        }
  207
+
  208
+        $tableColumn['nullable'] == 'NO' ? $notnull = true : $notnull = false;
  209
+        $tableColumn['index_type'] == 'PRIMARY' ? $primaryKey = true : $primaryKey = false;
1
Christophe Coevoet
stof added a note August 24, 2012

same for this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/Doctrine/DBAL/Schema/AkibanServerSchemaManager.php
((209 lines not shown))
  209
+        $tableColumn['index_type'] == 'PRIMARY' ? $primaryKey = true : $primaryKey = false;
  210
+
  211
+        $options = array(
  212
+            'length'        => $length,
  213
+            'notnull'       => $notnull,
  214
+            'default'       => $tableColumn['default'],
  215
+            'primary'       => $primaryKey,
  216
+            'precision'     => $precision,
  217
+            'scale'         => $scale,
  218
+            'fixed'         => $fixed,
  219
+            'unsigned'      => false,
  220
+            'autoincrement' => $autoincrement,
  221
+            'comment'       => NULL,
  222
+        );
  223
+
  224
+        return new Column($tableColumn['column_name'], \Doctrine\DBAL\Types\Type::getType($type), $options);
1
Christophe Coevoet
stof added a note August 24, 2012

please add a use statement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
tests/Doctrine/Tests/DBAL/Platforms/AkibanSrvPlatformTest.php
... ...
@@ -0,0 +1,182 @@
  1
+<?php
  2
+
  3
+namespace Doctrine\Tests\DBAL\Platforms;
  4
+
  5
+use Doctrine\DBAL\Platforms\AkibanServerPlatform;
  6
+use Doctrine\DBAL\Types\Type;
  7
+
  8
+require_once __DIR__ . '/../../TestInit.php';
2
Christophe Coevoet
stof added a note August 24, 2012

I don't think this line is needed anymore. @beberlei can you confirm ?

Padraig O'Sullivan
posulliv added a note August 25, 2012

The tests run fine without this line so I can remove it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Don't Add Me To Your Organization a.k.a The Travis Bot

This pull request passes (merged af23244 into e25c774).

Padraig O'Sullivan

Thanks for your review comments. I've applied the majority of them.

I'm going to create an implementation that uses PDO and see if I can get that as far. If I can get that functional this weekend, I'll close this pull request and open a new one with that implementation.

Christophe Coevoet
stof commented August 25, 2012

Note that a PDO-based implementation will normally require less code as the statement and connection classes are based on the PDO interfaces :)

Padraig O'Sullivan

Closing this pull request as it has been superseded by pull request 191.

Padraig O'Sullivan posulliv closed this August 27, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 91 unique commits by 1 author.

Aug 10, 2012
Padraig O'Sullivan Add akibansrv to list of available drivers in DriverManager class. 16e0692
Padraig O'Sullivan Add simple implementation of Driver interface for Akiban Server. aba8430
Padraig O'Sullivan Simple implementation of Connection interface for Akiban Server. Not …
…all methods are implemented yet.
2fe3944
Aug 11, 2012
Padraig O'Sullivan Add simple exception wrapper for AkibanSrv exceptions. 2851f2c
Padraig O'Sullivan Add skeleton for AkibanSrvStatement class that implements Statement i…
…nterface. Nearly all methods still need to be implemented.
6ce2ae9
Padraig O'Sullivan Add skeleton for Akiban Server schema manager. c5e757f
Padraig O'Sullivan Skeleton for AkibanServerPlatform implementation. Most methods need t…
…o be implemented.
c750b4e
Padraig O'Sullivan Update akiban driver implementation to use correct names for platform…
… and schema manager implementations.
b5e6946
Padraig O'Sullivan Update function for getting next sequence value. 4ad4453
Padraig O'Sullivan Implement function for generating SQL to create sequences. fa487b6
Padraig O'Sullivan Akiban does not need to implement function for returning now expressi…
…on. This is due to Akiban having a NOW() function that is compatible with MySQL.
025fd93
Padraig O'Sullivan Akiban does not support regular expressions at this time. ad5cd9f
Padraig O'Sullivan Implement getLocateExpression function. 74ff267
Padraig O'Sullivan Implement getDateDiffExpression function. 9e5af6b
Padraig O'Sullivan Implement getDateAddDaysExpression function. 227f159
Padraig O'Sullivan Implement getDateSubDaysExpression function. 4f25bd2
Padraig O'Sullivan Implement getDateAddMonthExpression function. b2141df
Padraig O'Sullivan Implement getDateSubMonthExpression function. 6c97818
Padraig O'Sullivan Implement getListTablesSQL function. 2fcc4c9
Padraig O'Sullivan Implement getListViewsSQL function. db4e494
Padraig O'Sullivan Implement getCreateViewSQL function. ed04fa2
Padraig O'Sullivan Implement getListDatabasesSQL function. 87c0974
Padraig O'Sullivan Add cascade to drop schema command. This ensures a schema is dropped …
…even if it contains tables.
755a2d4
Padraig O'Sullivan Akiban does not support ALTER SEQUENCE yet so throw an unsupported ex…
…ception when that function is called.
85e5f1c
Aug 13, 2012
Padraig O'Sullivan Implement getSchemaNames function. 1e96fff
Padraig O'Sullivan Implement dropDatabase function. cc50f53
Padraig O'Sullivan Implement createDatabase function. 4c8020b
Padraig O'Sullivan Add parameter checking to dropDatabase function. d4166e9
Padraig O'Sullivan Use functions from abstract class for trigger related functionality. d4003ab
Padraig O'Sullivan Copy implementation of _getPortableViewDefintion from PostgreSQL impl…
…ementation.
47b70ae
Padraig O'Sullivan Use PostgreSQL implementation of _getPortableUserDefinition function. 010cb79
Padraig O'Sullivan Implement _getPortableTableDefinition table. 8b547df
Padraig O'Sullivan Implement _getPortableDatabaseDefinition function. 240afe1
Padraig O'Sullivan Implement _getPortableSequenceDefintion function. d05326b
Padraig O'Sullivan Use copy of PostgreSQL keywords for Akiban Server keywords for now. 8259c93
Padraig O'Sullivan Akiban Server will not implement _getPortableTableForeignKeyDefinitio…
…n for now.
660dee4
Padraig O'Sullivan Implement getSubstringExpression function. 52c882f
Padraig O'Sullivan Simple implementation of getListTableIndexesSQL function. Not sure if…
… this is sufficient.
8703c4c
Padraig O'Sullivan Implement initializeDoctrineTypeMappings function. This function has …
…the current types Akiban Server supports. As Akiban Server supports more types, this function will need to be updated.
8fde2b7
Padraig O'Sullivan Implemented the getTimeTypeDeclarationSQL function. 81123e0
Padraig O'Sullivan Implement getDateTimeTypeDeclaration function. Taken from MySQL imple…
…mentation for now.
6d58a7a
Padraig O'Sullivan Implement getBooleanTypeDeclarationSQL function. 63889e3
Padraig O'Sullivan Implement getListSequencesSQL function. 269f118
Padraig O'Sullivan Throw unsupported operation exception if an attempt is made to change…
… transaction isolation level for a session.
32961fa
Padraig O'Sullivan No need for akiban server to implement convertBooleans function. 682e207
Padraig O'Sullivan Implement getAlterTableSQL function. 1ed0377
Padraig O'Sullivan Akbian Server does not have date or time data types that support time…
…zones (same as mysql).
05fed4d
Padraig O'Sullivan Implement initial version of _getCreateTableSQL function. b40d8bb
Padraig O'Sullivan use default implementation of getDropForeignKeySQL for Akiban. 541fb29
Padraig O'Sullivan Use default implementation for getAdvancedForeignKeyOptionsSQL function. 4c7c94a
Padraig O'Sullivan Akiban Server does not need getTableWhereClause function. 1df2d9a
Padraig O'Sullivan Implemenet getListTableColumnsSQL function. 1736d59
Padraig O'Sullivan Implemnet getListTableConstraintsSQL function. 3277021
Padraig O'Sullivan Throw un-supported operation exception for getListTableForeignKeysSQL…
… function in Akiban for now.
556273f
Padraig O'Sullivan Unit tests can now run against Akiban with most of them obviously fai…
…ling right now since we have not implemented the majority of functionality.
a9513da
Padraig O'Sullivan Explicitly specify Akiban does not support savepoints. Flesh out a fe…
…w methods in Connection and Statement classes so queries can be sent to Akiban now. This allows basic unit tests to pass. Will likely modify this implementation in the near future.
e8d0f49
Aug 14, 2012
Padraig O'Sullivan Implement transaction related methods in AkibanSrvConnection class. 68dc30d
Padraig O'Sullivan Implement columnCount function in AkibanSrvStatement class. 44bbb0f
Padraig O'Sullivan Specify how Akiban does bit and/or operationsin platform class. 180666e
Padraig O'Sullivan Modification to unit test that takes Akiban behavior into account. 31b9f20
Padraig O'Sullivan Implement quote method in AkibanSrvConnection class. Implementation i…
…s taken from OCI8 driver.
f18ef46
Padraig O'Sullivan Implement remaining methods in AkibanSrvStatement class. 490f1f4
Padraig O'Sullivan Corrections to test around fetch with classes. 499ba2d
Padraig O'Sullivan Got more unit tests to pass. Failing tests are now related to serial …
…data type not being supported at the moment. AkibanSrvStatement class needs to be cleaned up a little bit.
ccc65fb
Padraig O'Sullivan Use identity columns for auto-increment for now until support for ser…
…ial is added.
578ce0a
Padraig O'Sullivan Akiban does not support the FOR UPDATE clause at the moment. a48684c
Padraig O'Sullivan Akiban does not support nested transactions at the moment so only beg…
…in a new transaction if not already in a transaction.
3d4668f
Aug 15, 2012
Padraig O'Sullivan If running unit tests against Akiban, do not run tests related to tem…
…porary tables since Akiban does not support those.
200ebd8
Padraig O'Sullivan Get all required information about a sequence from the information_sc…
…hema.
15e3204
Padraig O'Sullivan Re-enable failing test. f737f40
Aug 16, 2012
Padraig O'Sullivan Implement lastInsertId function in AkibanSrvConnection now that currv…
…al support has been added to Akiban.
366ad07
Aug 22, 2012
Padraig O'Sullivan Use serial instead of identity columns since akiban now supports it. 40fe291
Aug 23, 2012
Padraig O'Sullivan Clear up exception message. ef8ba00
Padraig O'Sullivan Make some formatting of comments more consistent. 50e8ce0
Padraig O'Sullivan Remove un-needed variable in AkibanSrvStatement class. af2cc93
Padraig O'Sullivan Simplify code in AkibanSrvStatement class. 0eef622
Padraig O'Sullivan Clean up code in AkibanSrvStatement class around fetching of results. 1aa8278
Padraig O'Sullivan Be more consistent with string quoting. f276c65
Padraig O'Sullivan Implement getUniqueConstraintDeclarationSQL function. 4cf1dee
Padraig O'Sullivan Akiban does not support foreign key constraints. Explicitly specify t…
…hat in platform implementation.
2044afb
Padraig O'Sullivan Implement some of the remaining functions in Platform and Schema mana…
…ger.
a0cea52
Padraig O'Sullivan Add test for AkibanSchemaManager. 8931cf1
Padraig O'Sullivan Add tests for AkibanServerPlatform class. 390d5a9
Padraig O'Sullivan Expand on comments so it is clear what akiban does/does not support. ab0a456
Padraig O'Sullivan Correct unit tests around akiban platform class. f7b0275
Padraig O'Sullivan Revert unit tests back to way they used to be. 316ee6d
Padraig O'Sullivan Changed a unit test by accident. 116640e
Padraig O'Sullivan Akiban does not support savepoints so make sure test reflects that. f1dab8e
Aug 24, 2012
Padraig O'Sullivan Apply comments from pull request 188. Also clean up code to adhere to…
… doctrine coding standards.
abb7b55
Padraig O'Sullivan Missed one place where strict comparisons should be used. 6003fae
Aug 25, 2012
Padraig O'Sullivan Applying second round of review comments from pull request 188. af23244
Something went wrong with that request. Please try again.