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

DB Needs Transactions implemented. #268

Closed
lonnieezell opened this issue Sep 22, 2016 · 0 comments
Closed

DB Needs Transactions implemented. #268

lonnieezell opened this issue Sep 22, 2016 · 0 comments
Labels
database Issues or pull requests that affect the database layer in progress new feature PRs for new features
Milestone

Comments

@lonnieezell
Copy link
Member

lonnieezell commented Sep 22, 2016

I was holding off on this until I had a chance to think it through more. I think this can be implemented similarly to how it is in CI3. So, we would implement trans_start() and trans_complete() just like they were, basically.

In addition, though, I think we can add a new condensed version using a Closure:

$db->transaction(function($db){
    $db->insert();
    $db->insert();
    // etc...
});

Which basically wraps the closure in the familiar trans_start() and trans_complete methods, but is a little more obvious about what's included in the transaction.

@lonnieezell lonnieezell added database Issues or pull requests that affect the database layer new feature PRs for new features labels Sep 22, 2016
@lonnieezell lonnieezell added this to the Pre-Alpha 2 milestone Sep 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
database Issues or pull requests that affect the database layer in progress new feature PRs for new features
Projects
None yet
Development

No branches or pull requests

1 participant