From 426b29ae4244a745cbde5f2396d2406dc0b7ef2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=9B=E4=BA=9A=E8=8A=B3?= Date: Wed, 27 Apr 2022 10:01:39 +0000 Subject: [PATCH] update zh-cn/application-dev/database/database-relational-guidelines.md. Signed-off-by: @ge-yafang --- .../database/database-relational-guidelines.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/zh-cn/application-dev/database/database-relational-guidelines.md b/zh-cn/application-dev/database/database-relational-guidelines.md index 1a6318cef2..964901e32e 100644 --- a/zh-cn/application-dev/database/database-relational-guidelines.md +++ b/zh-cn/application-dev/database/database-relational-guidelines.md @@ -196,7 +196,7 @@ 示例代码如下: - ``` + ```js import data_rdb from '@ohos.data.rdb' const CREATE_TABLE_TEST = "CREATE TABLE IF NOT EXISTS test (" + "id INTEGER PRIMARY KEY AUTOINCREMENT, " + "name TEXT NOT NULL, " + "age INTEGER, " + "salary REAL, " + "blobType BLOB)"; @@ -213,7 +213,7 @@ 示例代码如下: - ``` + ```js var u8 = new Uint8Array([1, 2, 3]) const valueBucket = {"name": "Tom", "age": 18, "salary": 100.5, "blobType": u8,} let insertPromise = rdbStore.insert("test", valueBucket) @@ -226,7 +226,7 @@ 示例代码如下: - ``` + ```js let predicates = new data_rdb.RdbPredicates("test"); predicates.equalTo("name", "Tom") let promisequery = rdbStore.query(predicates) @@ -247,7 +247,7 @@ 示例代码如下: - ``` + ```js let promise = rdbStore.setDistributedTables(["test"]) promise.then(() => { console.info("setDistributedTables success.") @@ -263,7 +263,7 @@ 示例代码如下: - ``` + ```js let predicate = new data_rdb.RdbPredicates('test') predicate.inDevices(['12345678abcde']) let promise = rdbStore.sync(rdb.SyncMode.SYNC_MODE_PUSH, predicate) @@ -283,7 +283,7 @@ 示例代码如下: - ``` + ```js function storeObserver(devices) { for (let i = 0; i < devices.length; i++) { console.log('device=' + device[i] + ' data changed') @@ -302,7 +302,7 @@ 示例代码如下: - ``` + ```js let tableName = rdbStore.obtainDistributedTableName(deviceId, "test"); let resultSet = rdbStore.querySql("SELECT * FROM " + tableName) ``` -- GitLab