GithubHelp home page GithubHelp logo

Support Transaction Rollback about db HOT 6 CLOSED

upper avatar upper commented on August 25, 2024
Support Transaction Rollback

from db.

Comments (6)

xiam avatar xiam commented on August 25, 2024

Transactions were not supported because the initial approach of upper.io/db was being fully compatible with major SQL and NoSQL databases. MongoDB lacked supports for transactions and that was holding us back. Even now, support for transaction-like operatios in MongoDB still feels like black magic.

But after all, MongoDB should not be an obstacle. We'll still support CRUD compatibility across all adapters but we'll also introduce some database-specific features, like transactions.

Support for transactions is currently on the experimental branch but we need to document it and test it a bit more in order to release it. I think we'll be able to release it next week.

from db.

maxhawkins avatar maxhawkins commented on August 25, 2024

Do you have a pattern for dealing with unsupported behavior in drivers? Returning an error would make sense, but I'm not sure if there's another way.

Feature parity on -every- database seems hard to accomplish. For instance, on the AppEngine Data Store counting is a nontrivial operation and requires a separate MapReduce step.

On Thu, Jun 19, 2014 at 8:19 AM, Carlos Nieto [email protected]
wrote:

Transactions were not supported because the initial approach of upper.io/db was being fully compatible with major SQL and NoSQL databases. MongoDB lacked supports for transactions and that was holding us back. Even now, support for transaction-like operatios in MongoDB still feels like black magic.
But after all, MongoDB should not be an obstacle. We'll still support CRUD compatibility across all adapters but we'll also introduce some database-specific features, like transactions.

Support for transactions is currently on the experimental branch but we need to document it and test it a bit more in order to release it. I think we'll be able to release it next week.

Reply to this email directly or view it on GitHub:
#23 (comment)

from db.

xiam avatar xiam commented on August 25, 2024

I think returning error is a good and easy way of handling this situation, this way if we could eventually use transactions on mongodb we'll just have to remove the error and proceed.

For example, If you try to use db.Transaction() on the mongo adapter a newly introduced db.ErrUnsupported is returned (should it be db.ErrNotSupported or db.ErrUnsupportedOperation?).

from db.

maxhawkins avatar maxhawkins commented on August 25, 2024

Cool. ErrUnsupported sounds like the right way to go.

I'm considering writing an appengine data store driver and I'll use that error for the Count method.

On Thu, Jun 19, 2014 at 9:31 AM, Carlos Nieto [email protected]
wrote:

I think returning error is a good and easy way of handling this situation, this way if we could eventually use transactions on mongodb we'll just have to remove the error and proceed.
For example, If you try to use db.Transaction() on the mongo adapter a newly introduced db.ErrUnsupported [is returned][1](should it be db.ErrNotSupported or db.ErrUnsupportedOperation?).

[1]: https://github.com/upper/db/blob/experimental/mongo/database.go#L86

Reply to this email directly or view it on GitHub:
#23 (comment)

from db.

xiam avatar xiam commented on August 25, 2024

Test for PostgreSQL transactions: 2cec612#diff-e4728f444b24839e3f80adf3829bcba9 on experimental.

from db.

maxhawkins avatar maxhawkins commented on August 25, 2024

Working for me. Thanks.

from db.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.