diff --git a/distributeddatamgr/relational_store/BUILD.gn b/distributeddatamgr/relational_store/BUILD.gn index 560c94d4d153579497dd4bea9a91509e5015cec4..203e78f46fadac4b94fe18bc93e8e9567c82b77e 100644 --- a/distributeddatamgr/relational_store/BUILD.gn +++ b/distributeddatamgr/relational_store/BUILD.gn @@ -21,7 +21,6 @@ ohos_ndk_headers("native_rdb_ndk_header") { "./include/oh_cursor.h", "./include/oh_predicates.h", "./include/oh_rdb_transaction.h", - "./include/oh_rdb_types.h", "./include/oh_value_object.h", "./include/oh_values_bucket.h", "./include/relational_store.h", @@ -53,10 +52,9 @@ ohos_ndk_library("libnative_rdb_ndk") { "$ndk_headers_out_dir/database/rdb/oh_cursor.h", "$ndk_headers_out_dir/database/rdb/oh_predicates.h", "$ndk_headers_out_dir/database/rdb/oh_rdb_transaction.h", - "$ndk_headers_out_dir/database/rdb/oh_rdb_types.h", "$ndk_headers_out_dir/database/rdb/oh_value_object.h", "$ndk_headers_out_dir/database/rdb/oh_values_bucket.h", "$ndk_headers_out_dir/database/rdb/relational_store.h", "$ndk_headers_out_dir/database/rdb/relational_store_error_code.h", ] -} +} \ No newline at end of file diff --git a/distributeddatamgr/relational_store/include/oh_rdb_transaction.h b/distributeddatamgr/relational_store/include/oh_rdb_transaction.h index aa34f0228ea3a7be3dfa8500cccf0809af3c794b..3331a5e50b55bb6a70647544a215e8c723323f17 100644 --- a/distributeddatamgr/relational_store/include/oh_rdb_transaction.h +++ b/distributeddatamgr/relational_store/include/oh_rdb_transaction.h @@ -43,7 +43,6 @@ #include "database/rdb/oh_cursor.h" #include "database/rdb/oh_predicates.h" #include "database/rdb/oh_values_bucket.h" -#include "database/rdb/oh_rdb_types.h" #include "database/data/oh_data_values.h" #include "database/data/oh_data_values_buckets.h" @@ -199,7 +198,6 @@ int OH_RdbTrans_Insert(OH_Rdb_Transaction *trans, const char *table, const OH_VB * @param trans Represents a pointer to an instance of OH_Rdb_Transaction. * @param table Represents the target table. * @param rows Represents the rows data to be inserted into the table. - * @param resolution Represents the resolution when conflict occurs. * @param changes Represents the number of successful insertions. * @return Returns the status code of the execution. * Returns {@link RDB_OK} if the execution is successful. @@ -217,11 +215,10 @@ int OH_RdbTrans_Insert(OH_Rdb_Transaction *trans, const char *table, const OH_VB * Returns {@link RDB_E_SQLITE_IOERR} SQLite: Some kind of disk I/O error occurred. * Returns {@link RDB_E_SQLITE_TOO_BIG} SQLite: TEXT or BLOB exceeds size limit. * Returns {@link RDB_E_SQLITE_MISMATCH} SQLite: Data type mismatch. - * Returns {@link RDB_E_SQLITE_CONSTRAINT} SQLite: Abort due to constraint violation. * @since 18 */ int OH_RdbTrans_BatchInsert(OH_Rdb_Transaction *trans, const char *table, const OH_Data_VBuckets *rows, - Rdb_ConflictResolution resolution, int64_t *changes); + int64_t *changes); /** * @brief Updates data in the database based on specified conditions. diff --git a/distributeddatamgr/relational_store/include/oh_rdb_types.h b/distributeddatamgr/relational_store/include/oh_rdb_types.h deleted file mode 100644 index cf0f76bf07bf959828b225b6b355e11bcea4520a..0000000000000000000000000000000000000000 --- a/distributeddatamgr/relational_store/include/oh_rdb_types.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @addtogroup RDB - * @{ - * - * @brief The relational database (RDB) store manages data based on relational models. - * With the underlying SQLite database, the RDB store provides a complete mechanism for managing local databases. - * To satisfy different needs in complicated scenarios, the RDB store offers a series of APIs for performing operations - * such as adding, deleting, modifying, and querying data, and supports direct execution of SQL statements. - * - * @since 10 - */ - -/** - * @file oh_rdb_types.h - * - * @brief Provides type define related to the data value. - * - * @kit ArkData - * @library libnative_rdb_ndk.z.so - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * - * @since 18 - */ - -#ifndef OH_RDB_TYPES_H -#define OH_RDB_TYPES_H - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Describe the security area of the database. - * - * @since 18 - */ -typedef enum Rdb_ConflictResolution { - /** - * @brief Implements no operation when conflict occurs. - */ - RDB_CONFLICT_NONE = 1, - /** - * @brief Implements rollback operation when conflict occurs. - */ - RDB_CONFLICT_ROLLBACK, - /** - * @brief Implements abort operation when conflict occurs. - */ - RDB_CONFLICT_ABORT, - /** - * @brief Implements fail operation when conflict occurs. - */ - RDB_CONFLICT_FAIL, - /** - * @brief Implements ignore operation when conflict occurs. - */ - RDB_CONFLICT_IGNORE, - /** - * @brief Implements replace operation when conflict occurs. - */ - RDB_CONFLICT_REPLACE, -} Rdb_ConflictResolution; - -#ifdef __cplusplus -}; -#endif -#endif -/** @} */ \ No newline at end of file diff --git a/distributeddatamgr/relational_store/include/relational_store.h b/distributeddatamgr/relational_store/include/relational_store.h index 54d2cc405782a27d4028fe17102aeb47872a0e2d..79347bda9f82b01551ade4913160e92aa0e57a8b 100644 --- a/distributeddatamgr/relational_store/include/relational_store.h +++ b/distributeddatamgr/relational_store/include/relational_store.h @@ -44,7 +44,6 @@ #include "database/rdb/oh_value_object.h" #include "database/rdb/oh_values_bucket.h" #include "database/rdb/oh_rdb_transaction.h" -#include "database/rdb/oh_rdb_types.h" #ifdef __cplusplus extern "C" { @@ -345,19 +344,6 @@ int OH_Rdb_SetDbType(OH_Rdb_ConfigV2 *config, int dbType); */ int OH_Rdb_SetTokenizer(OH_Rdb_ConfigV2 *config, Rdb_Tokenizer tokenizer); -/** - * @brief Set property persist into config - * - * @param config Represents a pointer to {@link OH_Rdb_ConfigV2} instance. - * Indicates the configuration of the database related to this RDB store. - * @param isPersistent Indicates whether the database need persistence. - * @return Returns the status code of the execution. Successful execution returns RDB_OK, - * {@link RDB_OK} - success. - * {@link RDB_E_INVALID_ARGS} - The error code for common invalid args. - * @since 18 - */ -int OH_Rdb_SetPersistent(OH_Rdb_ConfigV2 *config, bool isPersistent); - /** * @brief Check if a tokenizer is supported or not. * @@ -501,36 +487,6 @@ int OH_Rdb_DeleteStoreV2(const OH_Rdb_ConfigV2 *config); */ int OH_Rdb_Insert(OH_Rdb_Store *store, const char *table, OH_VBucket *valuesBucket); -/** - * @brief Inserts a batch of data into the target table. - * - * @param store Represents a pointer to an {@link OH_Rdb_Store} instance. - * @param table Represents the target table. - * @param rows Represents the rows data to be inserted into the table. - * @param resolution Represents the resolution when conflict occurs. - * @param changes Represents the number of successful insertions. - * @return Returns the status code of the execution. - * Returns {@link RDB_OK} if the execution is successful. - * Returns {@link RDB_E_ERROR} database common error. - * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. - * Returns {@link RDB_E_ALREADY_CLOSED} database already closed. - * Returns {@link RDB_E_WAL_SIZE_OVER_LIMIT} the WAL file size over default limit. - * Returns {@link RDB_E_SQLITE_FULL} SQLite: The database is full. - * Returns {@link RDB_E_SQLITE_CORRUPT} database corrupted. - * Returns {@link RDB_E_SQLITE_PERM} SQLite: Access permission denied. - * Returns {@link RDB_E_SQLITE_BUSY} SQLite: The database file is locked. - * Returns {@link RDB_E_SQLITE_LOCKED} SQLite: A table in the database is locked. - * Returns {@link RDB_E_SQLITE_NOMEM} SQLite: The database is out of memory. - * Returns {@link RDB_E_SQLITE_READONLY} SQLite: Attempt to write a readonly database. - * Returns {@link RDB_E_SQLITE_IOERR} SQLite: Some kind of disk I/O error occurred. - * Returns {@link RDB_E_SQLITE_TOO_BIG} SQLite: TEXT or BLOB exceeds size limit. - * Returns {@link RDB_E_SQLITE_MISMATCH} SQLite: Data type mismatch. - * Returns {@link RDB_E_SQLITE_CONSTRAINT} SQLite: Abort due to constraint violation. - * @since 18 - */ -int OH_Rdb_BatchInsert(OH_Rdb_Store *store, const char *table, - const OH_Data_VBuckets *rows, Rdb_ConflictResolution resolution, int64_t *changes); - /** * @brief Updates data in the database based on specified conditions. * diff --git a/distributeddatamgr/relational_store/include/relational_store_error_code.h b/distributeddatamgr/relational_store/include/relational_store_error_code.h index c75b849e0a27769b2f621242b7d06217661a2cab..8030b391ca7214c7cfad8132139be536db4bd7cf 100644 --- a/distributeddatamgr/relational_store/include/relational_store_error_code.h +++ b/distributeddatamgr/relational_store/include/relational_store_error_code.h @@ -413,13 +413,6 @@ typedef enum OH_Rdb_ErrCode { * @since 18 */ RDB_E_TYPE_MISMATCH = (E_BASE + 64), - - /** - * @brief Data value type is null. - * - * @since 18 - */ - RDB_E_SQLITE_CONSTRAINT = (E_BASE + 65), } OH_Rdb_ErrCode; #ifdef __cplusplus diff --git a/distributeddatamgr/relational_store/libnative_rdb.ndk.json b/distributeddatamgr/relational_store/libnative_rdb.ndk.json index 5d4110e087074620dbbcfdfba17a5a37ba4cda57..e481f38cfce1e117767e40ab65c20ec96167ea44 100644 --- a/distributeddatamgr/relational_store/libnative_rdb.ndk.json +++ b/distributeddatamgr/relational_store/libnative_rdb.ndk.json @@ -44,10 +44,6 @@ "first_introduced": "14", "name":"OH_Rdb_SetDbType" }, - { - "first_introduced": "18", - "name":"OH_Rdb_SetPersistent" - }, { "first_introduced": "14", "name":"OH_Rdb_GetSupportedDbType" @@ -74,10 +70,6 @@ { "name":"OH_Rdb_Insert" }, - { - "first_introduced": "18", - "name":"OH_Rdb_BatchInsert" - }, { "name":"OH_Rdb_Update" },