Comments (1)
感谢支持
v2.*版本已经开发接近尾声了,近期将会发布
新版语法将会更加简洁,使用面向对象来编程,代码更加清晰。
举个例子,在新版本中,对事务处理代码会非常简洁(代码逻辑部分示例,版本暂未发布)。
ToDoManager.transaction().then(t => {
// 先新增一条记录
ToDoManager.insertEntity({
"id": "123",
"content": "测试"
}, {transaction: t})
.then(data=> {
// 再对新增的记录执行修改
return ToDoManager.updateEntity({
"update": [
{"key": "content", "value": "执行修改测试", "operator": "replace"} // 修改了content字段
],
"where": [
{"logic": "and", "key": "id", operator: "=", "value": "123"}
]
}, {transaction: t});
})
.then(data => {
// 事务提交
t.commit(() => { t.release(); });
})
.catch(ex => {
console.log('事务异常回滚', ex.message);
// 事务回滚
t.rollback(() => { t.release(); });
});
});```
from onela.
Related Issues (5)
- ....
- insert 默认字段问题 HOT 1
- oParameters.js bug HOT 6
- 这个项目才31个星啊,真的不敢用啊,感觉挺好的,加油, 来支持一下! HOT 2
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 onela.