harmony 鸿蒙oh_rdb_transaction.h
oh_rdb_transaction.h
Overview
Defines APIs and enums related to database transactions.
File to include: <database/rdb/oh_rdb_transaction.h>
Library: libnative_rdb_ndk.z.so
System capability: SystemCapability.DistributedDataManager.RelationalStore.Core
Since: 18
Related module: RDB
Summary
Types
Name | Description |
---|---|
typedef enum OH_RDB_TransType OH_RDB_TransType | Defines an enum for transaction types. |
typedef struct OH_RDB_TransOptions OH_RDB_TransOptions | Defines the OH_RDB_TransOptions struct. |
typedef struct OH_Rdb_Transaction OH_Rdb_Transaction | Defines the OH_Rdb_Transaction struct. |
Enums
Name | Description |
---|---|
OH_RDB_TransType { RDB_TRANS_DEFERRED = 0, RDB_TRANS_IMMEDIATE, RDB_TRANS_EXCLUSIVE, RDB_TRANS_BUTT } | Enumerates the transaction types of an RDB store. |
Functions
Name | Description |
---|---|
OH_RDB_TransOptions * OH_RdbTrans_CreateOptions (void) | Create a transaction configuration object. |
int OH_RdbTrans_DestroyOptions (OH_RDB_TransOptions *opitons) | Destroys a transaction configuration instance. |
int OH_RdbTransOption_SetType (OH_RDB_TransOptions *opitons, OH_RDB_TransType type) | Sets the transaction type of an RDB store. |
int OH_RdbTrans_Commit (OH_Rdb_Transaction *trans) | Commits a transaction. |
int OH_RdbTrans_Rollback (OH_Rdb_Transaction *trans) | Rolls back a transaction. |
int OH_RdbTrans_Insert (OH_Rdb_Transaction *trans, const char *table, const OH_VBucket *row, int64_t *rowId) | Inserts a row of data into a table. |
int OH_RdbTrans_BatchInsert (OH_Rdb_Transaction *trans, const char *table, const OH_Data_VBuckets *rows, Rdb_ConflictResolution resolution, int64_t *changes) | Inserts a batch of data into a table. |
int OH_RdbTrans_Update (OH_Rdb_Transaction *trans, const OH_VBucket *row, const OH_Predicates *predicates, int64_t *changes) | Updates data in an RDB store based on specified conditions. |
int OH_RdbTrans_Delete (OH_Rdb_Transaction *trans, const OH_Predicates *predicates, int64_t *changes) | Deletes data from the database based on the specified conditions. |
OH_Cursor * OH_RdbTrans_Query (OH_Rdb_Transaction *trans, const OH_Predicates *predicates, const char *columns[], int len) | Queries data in the database based on specified conditions. |
OH_Cursor * OH_RdbTrans_QuerySql (OH_Rdb_Transaction *trans, const char *sql, const OH_Data_Values *args) | Queries data in the database using the specified SQL statement. |
int OH_RdbTrans_Execute (OH_Rdb_Transaction *trans, const char *sql, const OH_Data_Values *args, OH_Data_Value **result) | Executes an SQL statement that contains specified parameters. |
int OH_RdbTrans_Destroy (OH_Rdb_Transaction *trans) | Destroys a transaction object. |
你可能感兴趣的鸿蒙文章
0
赞
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦