openharmony 鸿蒙 arkts-apis-data-relationalStore-t

2026-08-25 浏览 (1)

Types

NOTE

The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.

Assets10+

type Assets = Asset[]

Indicates an Asset array.

System capability: SystemCapability.DistributedDataManager.RelationalStore.Core

TypeDescription
Asset[]Array of assets.

ValueType

type ValueType = null|number|string|boolean|Uint8Array|Asset|Assets|Float32Array|bigint

Defines the types of the value in a KV pair. The type varies with the parameter function.

System capability: SystemCapability.DistributedDataManager.RelationalStore.Core

TypeDescription
null10+Null.
numberNumber.
stringString.
booleanBoolean.
Uint8Array10+Uint8 array.
Asset10+Asset.
If the value type is Asset, the type in the SQL statement for creating a table must be ASSET.
Assets10+Assets.
If the value type is Assets, the type in the SQL statement for creating a table must be ASSETS.
Float32Array12+Array of 32-bit floating-point numbers.
If the field type is Float32Array, the type in the SQL statement for creating a table must be floatvector(128).
bigint12+Integer of any length.
If the value type is bigint, the type in the SQL statement for creating a table must be UNLIMITED INT. For details, see Persisting RDB Store Data.
NOTE
The bigint type does not support value comparison and cannot be used with the following predicates: between, notBetween, greaterThan, lessThan, greaterThanOrEqualTo, lessThanOrEqualTo, orderByAsc, and orderByDesc
To write a value of bigint type, use BigInt() or add n to the end of the value, for example,'let data = BigInt(1234)' or 'let data = 1234n'.
If data of the number type is written to a bigint field, the type of the return value obtained (queried) is number but not bigint.

ValuesBucket

type ValuesBucket = Record<string, ValueType>

Defines the data in the form of a KV pair. ValuesBucket cannot be passed across threads using Sendable.

System capability: SystemCapability.DistributedDataManager.RelationalStore.Core

TypeDescription
Record<string, ValueType>Types of the key and value in a KV pair. The key type is string, and the value type is ValueType.

PRIKeyType10+

type PRIKeyType = number|string

Enumerates the types of the primary key in a row of a database table.

System capability: SystemCapability.DistributedDataManager.RelationalStore.Core

TypeDescription
numberThe primary key is a number.
stringThe primary key is a string.

UTCTime10+

type UTCTime = Date

Represents the data type of the UTC time.

System capability: SystemCapability.DistributedDataManager.RelationalStore.Core

TypeDescription
DateUTC time.

ModifyTime10+

type ModifyTime = Map<PRIKeyType, UTCTime>

Represents the data type of the primary key and modification time of a database table.

System capability: SystemCapability.DistributedDataManager.RelationalStore.Core

TypeDescription
Map<PRIKeyType, UTCTime>The key is the primary key of a row in the database table, and the value is the last modification time of the row in UTC format.

RowData23+

type RowData = Array<ValueType>

Defines a row of data in a database table.

Model restriction: This API can be used only in the stage model.

System capability: SystemCapability.DistributedDataManager.RelationalStore.Core

TypeDescription
Array<ValueType>Array of the types of ValueType.

RowsData23+

type RowsData = Array<RowData>

Defines multiple rows of data in a database table.

Model restriction: This API can be used only in the stage model.

System capability: SystemCapability.DistributedDataManager.RelationalStore.Core

TypeDescription
Array<RowData>Array of the RowData types.

你可能感兴趣的鸿蒙文章

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/iO6S0Xs2