Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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.

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

    Simple implementation of Connection interface for Akiban Server. Not …

    posulliv authored
    …all methods are implemented yet.
  4. Padraig O'Sullivan
  5. Padraig O'Sullivan

    Add skeleton for AkibanSrvStatement class that implements Statement i…

    posulliv authored
    …nterface. Nearly all methods still need to be implemented.
  6. Padraig O'Sullivan
  7. Padraig O'Sullivan
  8. Padraig O'Sullivan

    Update akiban driver implementation to use correct names for platform…

    posulliv authored
    … and schema manager implementations.
  9. Padraig O'Sullivan
  10. Padraig O'Sullivan
  11. Padraig O'Sullivan

    Akiban does not need to implement function for returning now expressi…

    posulliv authored
    …on. This is due to Akiban having a NOW() function that is compatible with MySQL.
  12. Padraig O'Sullivan
  13. Padraig O'Sullivan
  14. Padraig O'Sullivan
  15. Padraig O'Sullivan
  16. Padraig O'Sullivan
  17. Padraig O'Sullivan
  18. Padraig O'Sullivan
  19. Padraig O'Sullivan
  20. Padraig O'Sullivan
  21. Padraig O'Sullivan
  22. Padraig O'Sullivan
  23. Padraig O'Sullivan

    Add cascade to drop schema command. This ensures a schema is dropped …

    posulliv authored
    …even if it contains tables.
  24. Padraig O'Sullivan

    Akiban does not support ALTER SEQUENCE yet so throw an unsupported ex…

    posulliv authored
    …ception when that function is called.
Commits on Aug 13, 2012
  1. Padraig O'Sullivan
  2. Padraig O'Sullivan
  3. Padraig O'Sullivan
  4. Padraig O'Sullivan
  5. Padraig O'Sullivan
  6. Padraig O'Sullivan
  7. Padraig O'Sullivan
  8. Padraig O'Sullivan
  9. Padraig O'Sullivan
  10. Padraig O'Sullivan
  11. Padraig O'Sullivan
  12. Padraig O'Sullivan
  13. Padraig O'Sullivan
  14. Padraig O'Sullivan
  15. Padraig O'Sullivan

    Implement initializeDoctrineTypeMappings function. This function has …

    posulliv authored
    …the current types Akiban Server supports. As Akiban Server supports more types, this function will need to be updated.
  16. Padraig O'Sullivan
  17. Padraig O'Sullivan
  18. Padraig O'Sullivan
  19. Padraig O'Sullivan
  20. Padraig O'Sullivan

    Throw unsupported operation exception if an attempt is made to change…

    posulliv authored
    … transaction isolation level for a session.
  21. Padraig O'Sullivan
  22. Padraig O'Sullivan
  23. Padraig O'Sullivan
  24. Padraig O'Sullivan
  25. Padraig O'Sullivan
  26. Padraig O'Sullivan
  27. Padraig O'Sullivan
  28. Padraig O'Sullivan
  29. Padraig O'Sullivan
  30. Padraig O'Sullivan

    Throw un-supported operation exception for getListTableForeignKeysSQL…

    posulliv authored
    … function in Akiban for now.
  31. Padraig O'Sullivan

    Unit tests can now run against Akiban with most of them obviously fai…

    posulliv authored
    …ling right now since we have not implemented the majority of functionality.
Commits on Aug 14, 2012
  1. Padraig O'Sullivan

    Explicitly specify Akiban does not support savepoints. Flesh out a fe…

    posulliv authored
    …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.
  2. Padraig O'Sullivan
  3. Padraig O'Sullivan
  4. Padraig O'Sullivan
  5. Padraig O'Sullivan
  6. Padraig O'Sullivan
  7. Padraig O'Sullivan
  8. Padraig O'Sullivan
  9. Padraig O'Sullivan

    Got more unit tests to pass. Failing tests are now related to serial …

    posulliv authored
    …data type not being supported at the moment. AkibanSrvStatement class needs to be cleaned up a little bit.
  10. Padraig O'Sullivan
  11. Padraig O'Sullivan
  12. Padraig O'Sullivan

    Akiban does not support nested transactions at the moment so only beg…

    posulliv authored
    …in a new transaction if not already in a transaction.
Commits on Aug 15, 2012
  1. Padraig O'Sullivan

    If running unit tests against Akiban, do not run tests related to tem…

    posulliv authored
    …porary tables since Akiban does not support those.
  2. Padraig O'Sullivan
  3. Padraig O'Sullivan

    Re-enable failing test.

    posulliv authored
Commits on Aug 17, 2012
  1. Padraig O'Sullivan

    Implement lastInsertId function in AkibanSrvConnection now that currv…

    posulliv authored
    …al support has been added to Akiban.
Commits on Aug 22, 2012
  1. Padraig O'Sullivan
Commits on Aug 23, 2012
  1. Padraig O'Sullivan

    Clear up exception message.

    posulliv authored
  2. Padraig O'Sullivan
  3. Padraig O'Sullivan
  4. Padraig O'Sullivan
  5. Padraig O'Sullivan
  6. Padraig O'Sullivan
  7. Padraig O'Sullivan
  8. Padraig O'Sullivan

    Akiban does not support foreign key constraints. Explicitly specify t…

    posulliv authored
    …hat in platform implementation.
  9. Padraig O'Sullivan
  10. Padraig O'Sullivan
  11. Padraig O'Sullivan
Commits on Aug 24, 2012
  1. Padraig O'Sullivan
  2. Padraig O'Sullivan
  3. Padraig O'Sullivan
  4. Padraig O'Sullivan
  5. Padraig O'Sullivan
  6. Padraig O'Sullivan

    Apply comments from pull request 188. Also clean up code to adhere to…

    posulliv authored
    … doctrine coding standards.
  7. Padraig O'Sullivan
Commits on Aug 25, 2012
  1. Padraig O'Sullivan
Commits on Aug 27, 2012
  1. Padraig O'Sullivan
  2. Padraig O'Sullivan

    Remove un-needed require.

    posulliv authored
  3. Padraig O'Sullivan
  4. Padraig O'Sullivan
  5. Padraig O'Sullivan
Something went wrong with that request. Please try again.