未验证 提交 17784140 编写于 作者: O openharmony_ci 提交者: Gitee

!8274 【轻量级 PR】:update zh-cn/application-dev/database/database-relational-guidelines.md.

Merge pull request !8274 from 葛亚芳/N/A
...@@ -164,7 +164,7 @@ ...@@ -164,7 +164,7 @@
import data_rdb from '@ohos.data.rdb' 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)"; 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)";
const STORE_CONFIG = {name: "rdbstore.db",} const STORE_CONFIG = {name: "rdbstore.db"}
data_rdb.getRdbStore(STORE_CONFIG, 1, function (err, rdbStore) { data_rdb.getRdbStore(STORE_CONFIG, 1, function (err, rdbStore) {
rdbStore.executeSql(CREATE_TABLE_TEST ) rdbStore.executeSql(CREATE_TABLE_TEST )
console.info('create table done.') console.info('create table done.')
...@@ -179,7 +179,7 @@ ...@@ -179,7 +179,7 @@
```js ```js
var u8 = new Uint8Array([1, 2, 3]) var u8 = new Uint8Array([1, 2, 3])
const valueBucket = {"name": "Tom", "age": 18, "salary": 100.5, "blobType": u8,} const valueBucket = {"name": "Tom", "age": 18, "salary": 100.5, "blobType": u8}
let insertPromise = rdbStore.insert("test", valueBucket) let insertPromise = rdbStore.insert("test", valueBucket)
``` ```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册