Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Akiban Driver Implementation that Uses PDO #191

Closed
wants to merge 96 commits into from

6 participants

Padraig O'Sullivan Don't Add Me To Your Organization a.k.a The Travis Bot Christophe Coevoet Steve Müller Benjamin Eberlei Mike McMahon
Padraig O'Sullivan

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.

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
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
Padraig O'Sullivan Applying second round of review comments from pull request 188. af23244
Padraig O'Sullivan Akiban driver implementation that uses the PostgreSQL PDO driver. f9b8445
Padraig O'Sullivan Remove un-needed require. bc6f5da
Padraig O'Sullivan Skip tests that rely on lastInsertId function. 40104b8
Padraig O'Sullivan Small cleanup to adhere to coding standards. 06c65a8
Don't Add Me To Your Organization a.k.a The Travis Bot

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

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

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

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

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

Padraig O'Sullivan

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?

Christophe Coevoet

@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 :)

Padraig O'Sullivan

Sounds good to me! Thanks for the update :)

Steve Müller
Collaborator

@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.

Benjamin Eberlei
Owner

@posulliv Please provide this driver as a seperate package.

Benjamin Eberlei beberlei closed this December 20, 2013
Mike McMahon

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

Showing 96 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
Aug 27, 2012
Padraig O'Sullivan Akiban driver implementation that uses the PostgreSQL PDO driver. f9b8445
Padraig O'Sullivan Remove un-needed require. bc6f5da
Padraig O'Sullivan Skip tests that rely on lastInsertId function. 40104b8
Padraig O'Sullivan Small cleanup to adhere to coding standards. 06c65a8
Padraig O'Sullivan Resolve issue that only happens in test when run against different DB…
… than Akiban.
29dd2e9
Something went wrong with that request. Please try again.