Commit ccde2ca1 authored by Leon's avatar Leon

upload.

parent bfdb0579
...@@ -13,27 +13,11 @@ DB.addConnection({ ...@@ -13,27 +13,11 @@ DB.addConnection({
var query = DB.query(DEMO_CONN); var query = DB.query(DEMO_CONN);
query.begin(); query.begin();
try { try {
var user_id = query.selectValue({ var r = query.selectValue('SELECT 1', {});
table: 'sys_user2',
field: 'id',
where: { username: 'admin' }
});
if (query.lastError().isValid()) {
throw query.lastError().text();
}
print("user_id: ", user_id);
query.insertRow({
table: 'sys_user_conf',
data: {
user_id: user_id,
path: 'test/1',
text_data: 'test1'
}
});
if (query.lastError().isValid()) { if (query.lastError().isValid()) {
throw query.lastError().text(); throw query.lastError().text();
} }
print("r: ", r);
query.commit(); query.commit();
} catch (e) { } catch (e) {
query.rollback(); query.rollback();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment