From a26da1c23bdc5452e5752c568783e787ab97f24a Mon Sep 17 00:00:00 2001 From: MangTsang Date: Sat, 12 Feb 2022 14:04:03 +0800 Subject: [PATCH] support stage context for rdb Signed-off-by: MangTsang --- api/@ohos.data.rdb.d.ts | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index dfbcea11da..133939f94d 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -14,6 +14,7 @@ */ import { AsyncCallback } from './basic'; import { ResultSet } from './data/rdb/resultSet'; +import Context from "./application/Context"; /** * Provides methods for rdbStore create and delete. @@ -32,29 +33,31 @@ declare namespace rdb { * to obtain a rdb store. * * @note N/A - * @since 7 + * @since 8 * @sysCap SystemCapability.Data.DATA_APPDATAMGR - * @devices phone, tablet, tv, wearable, car + * + * @param context Indicates the context of application or capability. * @param config Indicates the configuration of the database related to this RDB store. The configurations include * the database path, storage mode, and whether the database is read-only. * @param version Indicates the database version for upgrade or downgrade. * @return Returns an RDB store {@link ohos.data.rdb.RdbStore}. */ - function getRdbStore(config: StoreConfig, version: number, callback: AsyncCallback): void; - function getRdbStore(config: StoreConfig, version: number): Promise; + function getRdbStore(context: Context, config: StoreConfig, version: number, callback: AsyncCallback): void; + function getRdbStore(context: Context, config: StoreConfig, version: number): Promise; /** * Deletes the database with a specified name. * * @note N/A - * @since 7 + * @since 8 * @sysCap SystemCapability.Data.DATA_APPDATAMGR - * @devices phone, tablet, tv, wearable, car + * + * @param context Indicates the context of application or capability. * @param name Indicates the database name. * @return Returns true if the database is deleted; returns false otherwise. */ - function deleteRdbStore(name: string, callback: AsyncCallback): void; - function deleteRdbStore(name: string): Promise; + function deleteRdbStore(context: Context, name: string, callback: AsyncCallback): void; + function deleteRdbStore(context: Context, name: string): Promise; /** * Provides methods for managing the relational database (RDB). -- Gitee