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

@posulliv

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
@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.
2fe3944
@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.
6ce2ae9
@posulliv posulliv Add skeleton for Akiban Server schema manager. c5e757f
@posulliv posulliv Skeleton for AkibanServerPlatform implementation. Most methods need t…
…o be implemented.
c750b4e
@posulliv posulliv Update akiban driver implementation to use correct names for platform…
… and schema manager implementations.
b5e6946
@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.
025fd93
@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.
755a2d4
@posulliv posulliv Akiban does not support ALTER SEQUENCE yet so throw an unsupported ex…
…ception when that function is called.
85e5f1c
@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…
…ementation.
47b70ae
@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.
660dee4
@posulliv posulliv Implement getSubstringExpression function. 52c882f
@posulliv posulliv Simple implementation of getListTableIndexesSQL function. Not sure if…
… this is sufficient.
8703c4c
@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.
8fde2b7
@posulliv posulliv Implemented the getTimeTypeDeclarationSQL function. 81123e0
@posulliv posulliv Implement getDateTimeTypeDeclaration function. Taken from MySQL imple…
…mentation for now.
6d58a7a
@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.
32961fa
@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).
05fed4d
@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.
556273f
@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.
a9513da
@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.
e8d0f49
@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.
f18ef46
@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.
ccc65fb
@posulliv posulliv Use identity columns for auto-increment for now until support for ser…
…ial is added.
578ce0a
@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.
3d4668f
@posulliv posulliv If running unit tests against Akiban, do not run tests related to tem…
…porary tables since Akiban does not support those.
200ebd8
@posulliv posulliv Get all required information about a sequence from the information_sc…
…hema.
15e3204
@posulliv posulliv Re-enable failing test. f737f40
@posulliv posulliv Implement lastInsertId function in AkibanSrvConnection now that currv…
…al support has been added to Akiban.
366ad07
@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.
2044afb
@posulliv posulliv Implement some of the remaining functions in Platform and Schema mana…
…ger.
a0cea52
@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.
abb7b55
@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
@travisbot

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

@travisbot

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

@travisbot

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

@posulliv

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

@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

Sounds good to me! Thanks for the update :)

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

@beberlei
Owner

@posulliv Please provide this driver as a seperate package.

@beberlei beberlei closed this
@MMcM

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 10, 2012
  1. @posulliv
Commits on Aug 11, 2012
  1. @posulliv
  2. @posulliv

    Simple implementation of Connection interface for Akiban Server. Not …

    posulliv authored
    …all methods are implemented yet.
  3. @posulliv
  4. @posulliv

    Add skeleton for AkibanSrvStatement class that implements Statement i…

    posulliv authored
    …nterface. Nearly all methods still need to be implemented.
  5. @posulliv
  6. @posulliv
  7. @posulliv

    Update akiban driver implementation to use correct names for platform…

    posulliv authored
    … and schema manager implementations.
  8. @posulliv
  9. @posulliv
  10. @posulliv

    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.
  11. @posulliv
  12. @posulliv
  13. @posulliv
  14. @posulliv
  15. @posulliv
  16. @posulliv
  17. @posulliv
  18. @posulliv
  19. @posulliv
  20. @posulliv
  21. @posulliv
  22. @posulliv

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

    posulliv authored
    …even if it contains tables.
  23. @posulliv

    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. @posulliv
  2. @posulliv
  3. @posulliv
  4. @posulliv
  5. @posulliv
  6. @posulliv
  7. @posulliv
  8. @posulliv
  9. @posulliv
  10. @posulliv
  11. @posulliv
  12. @posulliv
  13. @posulliv
  14. @posulliv
  15. @posulliv

    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. @posulliv
  17. @posulliv
  18. @posulliv
  19. @posulliv
  20. @posulliv

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

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

    Throw un-supported operation exception for getListTableForeignKeysSQL…

    posulliv authored
    … function in Akiban for now.
  31. @posulliv

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

    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.
Commits on Aug 14, 2012
  1. @posulliv
  2. @posulliv
  3. @posulliv
  4. @posulliv
  5. @posulliv
  6. @posulliv
  7. @posulliv
  8. @posulliv

    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.
  9. @posulliv
  10. @posulliv
  11. @posulliv

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

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

    posulliv authored
    …porary tables since Akiban does not support those.
  2. @posulliv
  3. @posulliv

    Re-enable failing test.

    posulliv authored
Commits on Aug 16, 2012
  1. @posulliv

    Implement lastInsertId function in AkibanSrvConnection now that currv…

    posulliv authored
    …al support has been added to Akiban.
Commits on Aug 22, 2012
  1. @posulliv
Commits on Aug 23, 2012
  1. @posulliv

    Clear up exception message.

    posulliv authored
  2. @posulliv
  3. @posulliv
  4. @posulliv
  5. @posulliv
  6. @posulliv
  7. @posulliv
  8. @posulliv

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

    posulliv authored
    …hat in platform implementation.
  9. @posulliv
  10. @posulliv
  11. @posulliv
  12. @posulliv
  13. @posulliv
  14. @posulliv
  15. @posulliv
  16. @posulliv
Commits on Aug 24, 2012
  1. @posulliv

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

    posulliv authored
    … doctrine coding standards.
  2. @posulliv
Commits on Aug 25, 2012
  1. @posulliv
Commits on Aug 27, 2012
  1. @posulliv
  2. @posulliv

    Remove un-needed require.

    posulliv authored
  3. @posulliv
  4. @posulliv
  5. @posulliv
Something went wrong with that request. Please try again.