spacecloud-io / space-cloud

Open source Firebase + Heroku to develop, scale and secure serverless apps on Kubernetes
https://space-cloud.io
Apache License 2.0
3.94k stars 222 forks source link

Need to rename transaction to batch in http and gRPC endpoints. #101

Closed YourTechBud closed 5 years ago

YourTechBud commented 5 years ago

The transaction support we have added works more like a batch. Let's make that more explicit. This will require us refactoring:

HeyItsJs commented 5 years ago

Here's how the batch API should look for javascript:

const batch = db.beginBatch();
batch.add(db.insert(col).docs(...docs));
batch.add(db.update(col).where(whereClause).set())

// Apply batch
batch.apply().then(res => ...).catch(ex => ...)

Same can be ported to other client libraries as well

KhushalPShah commented 5 years ago

Have done the refactoring and have created a Pull Request.