Comments (6)
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.
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.
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.
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 usedb.Transaction()
on themongo
adapter a newly introduceddb.ErrUnsupported
[is returned][1](should it bedb.ErrNotSupported
ordb.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.
Test for PostgreSQL transactions: 2cec612#diff-e4728f444b24839e3f80adf3829bcba9 on experimental
.
from db.
Working for me. Thanks.
from db.
Related Issues (20)
- Nested struct without db tag not omitted on insert or update
- Feature request: New tag to ignore identity columns on update
- [support] Is there a way to use `not` operator in SQL builder HOT 2
- Build a bigquery adapter HOT 1
- V3 documentation is down HOT 3
- Documentation v4 typo in sql builder example
- Slow query seems too ugly and not fancy. HOT 5
- Project abandoned? HOT 5
- packages need to be upgraded or changed HOT 1
- Slow query HOT 1
- It can't parse cockroachdb DSN HOT 2
- mysql error on scanning binary() field into []byte
- loading module retractions HOT 1
- Data race in template writer when running concurrent tests with go test -race
- help db.v3
- no data in mongodb
- Unhandled error in select.go causes a nil pointer dereference
- Goroutinue leak
- [Bug] TableExists for mssql adapter uses database name as table schema when checking for existence
- pgx v5 support HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from db.