Akiban Driver Implementation that Uses PDO #191

wants to merge 96 commits into


None yet

6 participants


Based on discussion in pull request 188 with @stof, I decided to modify the implementation for Akiban to use the PostgreSQL PDO driver instead of the native PHP client for PostgreSQL.

One piece of functionality that does not work with current version of Akiban is lastInsertId. This is because the implementation of CURRVAL for Akiban requires both schema name and sequence name be provided whereas PostgreSQL only requires sequence name (relevant source). I will attempt to get CURRVAL in Akiban implemented to have the same parameters as PostgreSQL.

This causes a few tests to fail in the test suite right now. Is there a way to mark a test as expected to fail for a specific database driver with the test suite? What I did in this pull request is skip any tests that use lastInsertId when testing against the Akiban platform. I'll update these tests to not be skipped when CURRVAL works as expected. Let me know if there is a better way to do that.

posulliv added some commits Aug 11, 2012
@posulliv posulliv Add akibansrv to list of available drivers in DriverManager class. 16e0692
@posulliv posulliv Add simple implementation of Driver interface for Akiban Server. aba8430
@posulliv posulliv Simple implementation of Connection interface for Akiban Server. Not …
…all methods are implemented yet.
@posulliv posulliv Add simple exception wrapper for AkibanSrv exceptions. 2851f2c
@posulliv posulliv Add skeleton for AkibanSrvStatement class that implements Statement i…
…nterface. Nearly all methods still need to be implemented.
@posulliv posulliv Add skeleton for Akiban Server schema manager. c5e757f
@posulliv posulliv Skeleton for AkibanServerPlatform implementation. Most methods need t…
…o be implemented.
@posulliv posulliv Update akiban driver implementation to use correct names for platform…
… and schema manager implementations.
@posulliv posulliv Update function for getting next sequence value. 4ad4453
@posulliv posulliv Implement function for generating SQL to create sequences. fa487b6
@posulliv posulliv 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.
@posulliv posulliv Akiban does not support regular expressions at this time. ad5cd9f
@posulliv posulliv Implement getLocateExpression function. 74ff267
@posulliv posulliv Implement getDateDiffExpression function. 9e5af6b
@posulliv posulliv Implement getDateAddDaysExpression function. 227f159
@posulliv posulliv Implement getDateSubDaysExpression function. 4f25bd2
@posulliv posulliv Implement getDateAddMonthExpression function. b2141df
@posulliv posulliv Implement getDateSubMonthExpression function. 6c97818
@posulliv posulliv Implement getListTablesSQL function. 2fcc4c9
@posulliv posulliv Implement getListViewsSQL function. db4e494
@posulliv posulliv Implement getCreateViewSQL function. ed04fa2
@posulliv posulliv Implement getListDatabasesSQL function. 87c0974
@posulliv posulliv Add cascade to drop schema command. This ensures a schema is dropped …
…even if it contains tables.
@posulliv posulliv Akiban does not support ALTER SEQUENCE yet so throw an unsupported ex…
…ception when that function is called.
@posulliv posulliv Implement getSchemaNames function. 1e96fff
@posulliv posulliv Implement dropDatabase function. cc50f53
@posulliv posulliv Implement createDatabase function. 4c8020b
@posulliv posulliv Add parameter checking to dropDatabase function. d4166e9
@posulliv posulliv Use functions from abstract class for trigger related functionality. d4003ab
@posulliv posulliv Copy implementation of _getPortableViewDefintion from PostgreSQL impl…
@posulliv posulliv Use PostgreSQL implementation of _getPortableUserDefinition function. 010cb79
@posulliv posulliv Implement _getPortableTableDefinition table. 8b547df
@posulliv posulliv Implement _getPortableDatabaseDefinition function. 240afe1
@posulliv posulliv Implement _getPortableSequenceDefintion function. d05326b
@posulliv posulliv Use copy of PostgreSQL keywords for Akiban Server keywords for now. 8259c93
@posulliv posulliv Akiban Server will not implement _getPortableTableForeignKeyDefinitio…
…n for now.
@posulliv posulliv Implement getSubstringExpression function. 52c882f
@posulliv posulliv Simple implementation of getListTableIndexesSQL function. Not sure if…
… this is sufficient.
@posulliv posulliv 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.
@posulliv posulliv Implemented the getTimeTypeDeclarationSQL function. 81123e0
@posulliv posulliv Implement getDateTimeTypeDeclaration function. Taken from MySQL imple…
…mentation for now.
@posulliv posulliv Implement getBooleanTypeDeclarationSQL function. 63889e3
@posulliv posulliv Implement getListSequencesSQL function. 269f118
@posulliv posulliv Throw unsupported operation exception if an attempt is made to change…
… transaction isolation level for a session.
@posulliv posulliv No need for akiban server to implement convertBooleans function. 682e207
@posulliv posulliv Implement getAlterTableSQL function. 1ed0377
@posulliv posulliv Akbian Server does not have date or time data types that support time…
…zones (same as mysql).
@posulliv posulliv Implement initial version of _getCreateTableSQL function. b40d8bb
@posulliv posulliv use default implementation of getDropForeignKeySQL for Akiban. 541fb29
@posulliv posulliv Use default implementation for getAdvancedForeignKeyOptionsSQL function. 4c7c94a
@posulliv posulliv Akiban Server does not need getTableWhereClause function. 1df2d9a
@posulliv posulliv Implemenet getListTableColumnsSQL function. 1736d59
@posulliv posulliv Implemnet getListTableConstraintsSQL function. 3277021
@posulliv posulliv Throw un-supported operation exception for getListTableForeignKeysSQL…
… function in Akiban for now.
@posulliv posulliv 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.
@posulliv posulliv 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.
@posulliv posulliv Implement transaction related methods in AkibanSrvConnection class. 68dc30d
@posulliv posulliv Implement columnCount function in AkibanSrvStatement class. 44bbb0f
@posulliv posulliv Specify how Akiban does bit and/or operationsin platform class. 180666e
@posulliv posulliv Modification to unit test that takes Akiban behavior into account. 31b9f20
@posulliv posulliv Implement quote method in AkibanSrvConnection class. Implementation i…
…s taken from OCI8 driver.
@posulliv posulliv Implement remaining methods in AkibanSrvStatement class. 490f1f4
@posulliv posulliv Corrections to test around fetch with classes. 499ba2d
@posulliv posulliv 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.
@posulliv posulliv Use identity columns for auto-increment for now until support for ser…
…ial is added.
@posulliv posulliv Akiban does not support the FOR UPDATE clause at the moment. a48684c
@posulliv posulliv Akiban does not support nested transactions at the moment so only beg…
…in a new transaction if not already in a transaction.
@posulliv posulliv If running unit tests against Akiban, do not run tests related to tem…
…porary tables since Akiban does not support those.
@posulliv posulliv Get all required information about a sequence from the information_sc…
@posulliv posulliv Re-enable failing test. f737f40
@posulliv posulliv Implement lastInsertId function in AkibanSrvConnection now that currv…
…al support has been added to Akiban.
@posulliv posulliv Use serial instead of identity columns since akiban now supports it. 40fe291
@posulliv posulliv Clear up exception message. ef8ba00
@posulliv posulliv Make some formatting of comments more consistent. 50e8ce0
@posulliv posulliv Remove un-needed variable in AkibanSrvStatement class. af2cc93
@posulliv posulliv Simplify code in AkibanSrvStatement class. 0eef622
@posulliv posulliv Clean up code in AkibanSrvStatement class around fetching of results. 1aa8278
@posulliv posulliv Be more consistent with string quoting. f276c65
@posulliv posulliv Implement getUniqueConstraintDeclarationSQL function. 4cf1dee
@posulliv posulliv Akiban does not support foreign key constraints. Explicitly specify t…
…hat in platform implementation.
@posulliv posulliv Implement some of the remaining functions in Platform and Schema mana…
@posulliv posulliv Add test for AkibanSchemaManager. 8931cf1
@posulliv posulliv Add tests for AkibanServerPlatform class. 390d5a9
@posulliv posulliv Expand on comments so it is clear what akiban does/does not support. ab0a456
@posulliv posulliv Correct unit tests around akiban platform class. f7b0275
@posulliv posulliv Revert unit tests back to way they used to be. 316ee6d
@posulliv posulliv Changed a unit test by accident. 116640e
@posulliv posulliv Akiban does not support savepoints so make sure test reflects that. f1dab8e
@posulliv posulliv Apply comments from pull request 188. Also clean up code to adhere to…
… doctrine coding standards.
@posulliv posulliv Missed one place where strict comparisons should be used. 6003fae
@posulliv posulliv Applying second round of review comments from pull request 188. af23244
@posulliv posulliv Akiban driver implementation that uses the PostgreSQL PDO driver. f9b8445
@posulliv posulliv Remove un-needed require. bc6f5da
@posulliv posulliv Skip tests that rely on lastInsertId function. 40104b8
@posulliv posulliv Small cleanup to adhere to coding standards. 06c65a8

This pull request fails (merged 06c65a8 into bb88ba7).


This pull request fails (merged 06c65a8 into bb88ba7).


This pull request passes (merged 29dd2e9 into bb88ba7).

posulliv commented Sep 6, 2012

Just wanted to check in because I will be away for a week and see if there any comments on this pull request that I should address before I leave?

stof commented Sep 6, 2012

@posulliv the priority right now is to manage the release of 2.3. There is no hurry to merge it as Doctrine 2.4 is due in 6 months :)

posulliv commented Sep 6, 2012

Sounds good to me! Thanks for the update :)


@posulliv What's the status of this PR? Is the implementation finished? First off you need to rebase this PR against master, as it is not mergeable anymore.


@posulliv Please provide this driver as a seperate package.

@beberlei beberlei closed this Dec 20, 2013
MMcM commented Jan 14, 2014

There is a new version of this branch for FoundationDB SQL Layer, which is the new name of Akiban Server. It is all synced with master and up-to-date with product enhancements on our side.

There are two challenges to releasing this as a separate package as suggested here.

  • It will not be supported as a driver by name. Which means it cannot be specified in the Symfony parameters file, only as a driver_class in the config file. Which locks us out of being supported by the current DoctrineStep. And, since we will not appear in getAvailableDrivers, we are likewise locked out of a more dynamic version of such tools.
  • Requesting PORTABILITY_RTRIM, it will be anded away by the PORTABILITY_OTHERVENDORS mask, which is chosen by platform name. Like many other systems, we need any trimming to happen on the client side.

Do you have recommendations for how we can meet your desire to keep the number of systems supported in the core manageable without making our addition seem second-class?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment