openharmony 鸿蒙 capi-rdb-oh-vbucket

2026-08-25 浏览 (1)

OH_VBucket

typedef struct {...} OH_VBucket

Overview

Defines a struct for the types of the key and value in a KV pair.

Since: 10

Related module: RDB

Header file: oh_values_bucket.h

Member Variables

NameDescription
int64_t idUnique identifier of the OH_VBucket struct.
uint16_t capabilityNumber of the KV pairs in the struct.

Member Functions

NameDescription
int (*putText)(OH_VBucket *bucket, const char *field, const char *value)Puts a char* value into the OH_VBucket object in the given column.
int (*putInt64)(OH_VBucket *bucket, const char *field, int64_t value)Puts an int64_t value into the OH_VBucket object in the given column.
int (*putReal)(OH_VBucket *bucket, const char *field, double value)Puts a double value into the OH_VBucket object in the given column.
int (*putBlob)(OH_VBucket *bucket, const char *field, const uint8_t *value, uint32_t size)Puts a const uint8_t * value into the OH_VBucket object in the given column.
int (*putNull)(OH_VBucket *bucket, const char *field)Puts a null value into the OH_VBucket object in the given column.
int (*clear)(OH_VBucket *bucket)Clears an OH_VBucket object.
int (*destroy)(OH_VBucket *bucket)Destroys an OH_VBucket object and reclaims the memory occupied.

Member Function Description

putText()

int (*putText)(OH_VBucket *bucket, const char *field, const char *value)

Description

Puts a char* value into the OH_VBucket object in the given column.

Since: 10

Parameters

NameDescription
OH_VBucket *bucketPointer to the OH_VBucket instance.
const char *fieldPointer to the column name in the database table.
const char *valuePointer to the value to put.

Returns

TypeDescription
intReturns RDB_OK if the operation is successful; returns an error code otherwise.

putInt64()

int (*putInt64)(OH_VBucket *bucket, const char *field, int64_t value)

Description

Puts an int64_t value into the OH_VBucket object in the given column.

Since: 10

Parameters

NameDescription
OH_VBucket *bucketPointer to the OH_VBucket instance.
const char *fieldPointer to the column name in the database table.
int64_t valuePointer to the value to put.

Returns

TypeDescription
intReturns RDB_OK if the operation is successful; returns an error code otherwise.

putReal()

int (*putReal)(OH_VBucket *bucket, const char *field, double value)

Description

Puts a double value into the OH_VBucket object in the given column.

Since: 10

Parameters

NameDescription
OH_VBucket *bucketPointer to the OH_VBucket instance.
const char *fieldPointer to the column name in the database table.
double valuePointer to the value to put.

Returns

TypeDescription
intReturns RDB_OK if the operation is successful; returns an error code otherwise.

putBlob()

int (*putBlob)(OH_VBucket *bucket, const char *field, const uint8_t *value, uint32_t size)

Description

Puts a const uint8_t * value into the OH_VBucket object in the given column.

Since: 10

Parameters

NameDescription
OH_VBucket *bucketPointer to the OH_VBucket instance.
const char *fieldPointer to the column name in the database table.
const uint8_t *valuePointer to the value to put.
uint32_t sizeValue length.

Returns

TypeDescription
intReturns RDB_OK if the operation is successful; returns an error code otherwise.

putNull()

int (*putNull)(OH_VBucket *bucket, const char *field)

Description

Puts a null value into the OH_VBucket object in the given column.

Since: 10

Parameters

NameDescription
OH_VBucket *bucketPointer to the OH_VBucket instance.
const char *fieldPointer to the column name in the database table.

Returns

TypeDescription
intReturns RDB_OK if the operation is successful; returns an error code otherwise.

clear()

int (*clear)(OH_VBucket *bucket)

Description

Clears the OH_VBucket object.

Since: 10

Parameters

NameDescription
OH_VBucket *bucketPointer to the OH_VBucket instance.

Returns

TypeDescription
intReturns RDB_OK if the operation is successful; returns an error code otherwise.

destroy()

int (*destroy)(OH_VBucket *bucket)

Description

Destroys the OH_VBucket object and reclaims the memory occupied by the object.

Since: 10

Parameters

NameDescription
OH_VBucket *bucketPointer to the OH_VBucket instance.

Returns

TypeDescription
intReturns RDB_OK if the operation is successful; returns an error code otherwise.

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 js-apis-distributedKVStore-sys

openharmony 鸿蒙 capi-oh-preferences-h

openharmony 鸿蒙 capi-udmf-oh-udshyperlink

openharmony 鸿蒙 js-apis-data-dataSharePredicates

openharmony 鸿蒙 capi-udmf-oh-udsappitem

openharmony 鸿蒙 capi-rdb-oh-data-vbuckets

openharmony 鸿蒙 capi-rdb-oh-predicates

openharmony 鸿蒙 capi-rdb-oh-data-value

openharmony 鸿蒙 capi-preferences-oh-preferencespair

openharmony 鸿蒙 errorcode-datashare

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/5hrSnHC4