Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T14733 Data Mapper PDO Connection #14824

Merged
merged 27 commits into from
Feb 8, 2020
Merged

T14733 Data Mapper PDO Connection #14824

merged 27 commits into from
Feb 8, 2020

Conversation

niden
Copy link
Member

@niden niden commented Feb 8, 2020

Hello!

In raising this pull request, I confirm the following:

  • I have read and understood the Contributing Guidelines
  • I have checked that another pull request for this purpose does not exist
  • I wrote some tests for this PR
  • I have updated the relevant CHANGELOG
  • I have created a PR for the documentation about this change

Added new PDO wrapper for the Data Mapper implementation, with decorated instance, locator and profiler

  • DM\Connection
  • DM\Connection\Decorated
  • DM\Profiler\Profiler
  • DM\Profiler\MemoryLogger
  • DM\ConnectionLocator
    This component will be used in the Data Mapper implementation but can be used as a stand alone component for PDO connections.

Thanks

@niden niden self-assigned this Feb 8, 2020
@niden niden added 4.1.0 documentation Documentation required new feature request Planned Feature or New Feature Request labels Feb 8, 2020
Copy link
Member

@ruudboon ruudboon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work buddy!


if !this->pdo {
// connect
this->profiler->start(__FUNCTION__);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make the profiler optional for perfomance?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The if statement is in the Profiler class (active). It was a tradeoff between putting if statements in every fetch method and not having one method call vs. having the method call and the if is in the profiler.

* @license https://github.com/atlasphp/Atlas.Pdo/blob/1.x/LICENSE.md
*/

namespace Phalcon\DM\Pdo;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the the DM can be a bit confusing. This could also be Device management, Device mapper, Distributed Mama's ;) etc. Can we just name it DataMapper? It isn't super long, and I don't see the advantages of abbreviation here.

@niden niden merged commit 27facc9 into phalcon:4.1.x Feb 8, 2020
@niden niden deleted the T14733-dm-connection-3 branch February 8, 2020 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation required new feature request Planned Feature or New Feature Request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants