<!--
{
  "documentType" : "article",
  "framework" : "CKToolJS",
  "identifier" : "/documentation/CKToolJS/database-structures-and-enumerations",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Database Structures and Enumerations"
}
-->

# Database Structures and Enumerations

## Topics

### Structures

[`dictionary CKDBAsset {
	Int64? size;
	string? receipt;
	string? fileChecksum;
	string? wrappingKey;
	string? referenceChecksum;
	string? downloadUrl;
};`](/documentation/CKToolJS/CKDBAsset)

An object that represents an asset uploaded to CloudKit.

[`dictionary CKDBAssetUploadUrlResponse {
	string url;
};`](/documentation/CKToolJS/CKDBAssetUploadUrlResponse)

An object that represents the results of creating an asset upload URL.

[`dictionary CKDBChangeMetadata {
	string? deviceId;
	date timestamp;
	string userRecordName;
};`](/documentation/CKToolJS/CKDBChangeMetadata)

An object that represents metadata about a record change via creation or modification.

[`dictionary CKDBCreateAssetUploadUrlRequestBody {
	string recordType;
	string fieldName;
	Int64? size;
};`](/documentation/CKToolJS/CKDBCreateAssetUploadUrlRequestBody)

An object that represents the request for creating an asset upload URL.

[`dictionary CKDBCreateRecordRequestBody {
	string? recordName;
	string recordType;
	dictionary fields;
	boolean? createShortGuid;
	CKDBNullableReference? share;
	CKDBNullableReference? parent;
	CKDBForRecord? forRecord;
	CKDBPermissionType? publicPermission;
	CKDBShareParticipant[]? participants;
};`](/documentation/CKToolJS/CKDBCreateRecordRequestBody)

An object that represents the request to create a new record.

[`dictionary CKDBCreateZoneRequestBody {
	string zoneName;
	string? zoneType;
};`](/documentation/CKToolJS/CKDBCreateZoneRequestBody)

An object that represents the request to create a new zone.

[`dictionary CKDBDeleteRecordsByQueryRequestBody {
	boolean? dryRun;
	string recordType;
	CKDBQueryFilter[]? filters;
	Int32? resultsLimit;
	string? continuationToken;
};`](/documentation/CKToolJS/CKDBDeleteRecordsByQueryRequestBody)

An object that represents the request to delete multiple records that match a query.

[`dictionary CKDBDeletedRecordResult {
	string type;
	string recordName;
};`](/documentation/CKToolJS/CKDBDeletedRecordResult)

An object that represents a deleted record result.

[`dictionary CKDBErrorRecordResult {
	string type;
	string? recordName;
	string errorCode;
	string message;
};`](/documentation/CKToolJS/CKDBErrorRecordResult)

An object that represents a record lookup failure.

[`dictionary CKDBExistingRecordResult {
	string type;
	string recordName;
	CKDBRecord record;
};`](/documentation/CKToolJS/CKDBExistingRecordResult)

An object that represents a successful record result.

[`dictionary CKDBForRecord {
	string recordName;
	string recordChangeTag;
};`](/documentation/CKToolJS/CKDBForRecord)

An object that represents a record that is being shared.

[`dictionary CKDBLocation {
	Double latitude;
	Double longitude;
	Double? altitude;
	Double? horizontalAccuracy;
	Double? verticalAccuracy;
	Double? course;
	Double? speed;
	date? timestamp;
};`](/documentation/CKToolJS/CKDBLocation)

An object that represents a location field value.

[`dictionary CKDBLookupRecordsRequestBody {
	string[] recordNames;
	string[]? requestedFields;
};`](/documentation/CKToolJS/CKDBLookupRecordsRequestBody)

An object that represents the request for looking up multiple records by record name.

[`dictionary CKDBLookupRecordsResponse {
	CKDBRecordResult[] recordResults;
};`](/documentation/CKToolJS/CKDBLookupRecordsResponse)

An object that represents the results of a batch record lookup operation.

[`dictionary CKDBModifyRecordRequestBody {
	string recordType;
	string? recordChangeTag;
	dictionary fields;
	boolean? createShortGuid;
	CKDBNullableReference? share;
	CKDBNullableReference? parent;
	CKDBForRecord? forRecord;
	CKDBPermissionType? publicPermission;
	CKDBShareParticipant[]? participants;
};`](/documentation/CKToolJS/CKDBModifyRecordRequestBody)

An object that represents the request for updating an existing record.

[`dictionary CKDBNullableReference {
	string? recordName;
	CKDBZoneId? zone;
	CKDBRecordReferenceAction? action;
};`](/documentation/CKToolJS/CKDBNullableReference)

An object that represents a reference to another record.

[`dictionary CKDBPagedBatchDeleteResponse {
	string? continuationToken;
	Int32 deletedCount;
	CKDBBatchDeleteError[] errors;
};`](/documentation/CKToolJS/CKDBPagedBatchDeleteResponse)

An object that represents the results of a paginated batch delete operation.

[`dictionary CKDBQuery {
	string recordType;
	CKDBQueryFilter[]? filters;
	CKDBQuerySort[]? sorts;
};`](/documentation/CKToolJS/CKDBQuery)

An object that represents a query for searching records.

[`dictionary CKDBQueryFilter {
	string? fieldName;
	CKDBRecordFieldValue fieldValue;
	CKDBQueryFilterType type;
	Double? radiusInKilometers;
};`](/documentation/CKToolJS/CKDBQueryFilter)

An object that represents the logical conditions for determining whether a record matches the query.

[`dictionary CKDBQueryRecordsRequestBody {
	CKDBQuery query;
	Int32? resultsLimit;
	string? continuationToken;
	string[]? requestedFields;
};`](/documentation/CKToolJS/CKDBQueryRecordsRequestBody)

An object that represents the request for fetching multiple records that match a query.

[`dictionary CKDBQuerySort {
	string? fieldName;
	CKDBQuerySortOrder order;
};`](/documentation/CKToolJS/CKDBQuerySort)

An object that represents a sort descriptor that specifies how to order fetched records.

[`dictionary CKDBRecord {
	string recordName;
	string recordType;
	string recordChangeTag;
	CKDBChangeMetadata created;
	CKDBChangeMetadata modified;
	dictionary fields;
	dictionary? otherSystemFields;
	CKDBNullableReference? share;
	CKDBNullableReference? parent;
	string? shortGuid;
	CKDBPermissionType? publicPermission;
	CKDBShareParticipant[]? participants;
	CKDBShareParticipant? owner;
	CKDBShareParticipant? currentUserParticipant;
	CKDBStableUrl? stableUrl;
	CKDBZoneId? zone;
};`](/documentation/CKToolJS/CKDBRecord)

An object that represents a record in a database.

[`dictionary CKDBRecordChangesRequestBody {
	string? changeToken;
	Int32? resultsLimit;
	string[]? requestedRecordTypes;
	string[]? requestedFields;
};`](/documentation/CKToolJS/CKDBRecordChangesRequestBody)

An object that represents the request for fetching changes since a specified zone change token.

[`dictionary CKDBRecordChangesResponse {
	CKDBRecordResult[] recordResults;
	boolean moreComing;
	string? changeToken;
};`](/documentation/CKToolJS/CKDBRecordChangesResponse)

An object that represents the results of a record changes lookup operation.

[`dictionary CKDBRecordReference {
	string recordName;
	string? owner;
	CKDBZoneId? zone;
	CKDBRecordReferenceAction? action;
};`](/documentation/CKToolJS/CKDBRecordReference)

An object that represents a reference to a CloudKit database record.

[`dictionary CKDBRecordResponse {
	CKDBRecord record;
};`](/documentation/CKToolJS/CKDBRecordResponse)

An object that represents the results of a record lookup operation.

[`dictionary CKDBRecordResult {
	string type;
};`](/documentation/CKToolJS/CKDBRecordResult)

An object that represents a record when the lookup operation can potentially return deleted records or fail partially when looking up some of the record.

[`dictionary CKDBRecordsResponse {
	string? continuationToken;
	CKDBRecord[] records;
};`](/documentation/CKToolJS/CKDBRecordsResponse)

An object that represents the results of a batch record lookup operation.

[`dictionary CKDBResolveRecordRequestBody {
	boolean? shouldFetchRootRecord;
	string[]? requestedFields;
};`](/documentation/CKToolJS/CKDBResolveRecordRequestBody)

An object that represents a request for fetching a record given its `shortGuid`.

[`dictionary CKDBResolveRecordResponse {
	CKDBResolvedRecord record;
};`](/documentation/CKToolJS/CKDBResolveRecordResponse)

An object that represents the results of looking up a record by its `shortGuid`.

[`dictionary CKDBResolvedRecord {
	string shortGuid;
	string? containerId;
	CKEnvironment? environment;
	string? databaseType;
	CKDBZoneId? zone;
	string? rootRecordName;
	CKDBRecord? share;
	CKDBRecord? rootRecord;
	CKDBRecord? resolvedRecord;
	CKDBRecord[]? ancestorRecords;
	CKDBShareParticipantType? participantType;
	CKDBShareAcceptanceStatus? participantStatus;
	CKDBPermissionType? participantPermission;
	CKDBUserIdentity? userIdentity;
	CKDBSharePotentialParticipant[]? potentialMatches;
	string? webpageUrl;
};`](/documentation/CKToolJS/CKDBResolvedRecord)

An object that represents a shared record fetched using its `shortGuid`.

[`dictionary CKDBSchemaImportRequestBody {
	File file;
};`](/documentation/CKToolJS/CKDBSchemaImportRequestBody)

An object that contains a schema file to be applied to a container environment.

[`dictionary CKDBSessionUser {
	string userRecordName;
};`](/documentation/CKToolJS/CKDBSessionUser)

An object that represents the current user.

[`dictionary CKDBSessionUserResponse {
	CKDBSessionUser user;
};`](/documentation/CKToolJS/CKDBSessionUserResponse)

An object that contains the result of looking up the current user.

[`dictionary CKDBShareParticipant {
	string? participantId;
	CKDBUserIdentity userIdentity;
	CKDBShareParticipantType? type;
	CKDBShareAcceptanceStatus? acceptanceStatus;
	CKDBPermissionType? permission;
};`](/documentation/CKToolJS/CKDBShareParticipant)

An object that represents a share participant.

[`dictionary CKDBSharePotentialParticipant {
	string? participantId;
	string? emailAddress;
	string? phoneNumber;
};`](/documentation/CKToolJS/CKDBSharePotentialParticipant)

An object that represents a potential participant for a share.

[`dictionary CKDBStableUrl {
	string? routingKey;
	string? shortTokenHash;
	string? protectedFullToken;
	string? encryptedPublicSharingKey;
	string? displayedHostname;
};`](/documentation/CKToolJS/CKDBStableUrl)

Internal use only.

[`dictionary CKDBStreamingAsset {
	string? fileSignature;
	string? referenceSignature;
	string? uploadReceipt;
	string? downloadUrl;
	Int64? requestedSize;
	Int64? uploadedSize;
	Int64? reservedSize;
};`](/documentation/CKToolJS/CKDBStreamingAsset)

A streaming asset object that represents a streaming asset in CloudKit.

[`dictionary CKDBUserIdentity {
	string? userRecordName;
	CKDBUserNameComponents? nameComponents;
	CKDBUserIdentityLookupInfo? lookupInfo;
};`](/documentation/CKToolJS/CKDBUserIdentity)

An object that identifies a user participating in a share.

[`dictionary CKDBUserIdentityLookupInfo {
	string? userRecordName;
	string? emailAddress;
	string? phoneNumber;
};`](/documentation/CKToolJS/CKDBUserIdentityLookupInfo)

An object that represents lookup information for a user.

[`dictionary CKDBUserNameComponents {
	string? givenName;
	string? middleName;
	string? familyName;
	string? namePrefix;
	string? nameSuffix;
	string? nickname;
	string? phoneticRepresentation;
};`](/documentation/CKToolJS/CKDBUserNameComponents)

An object that represents the user’s name.

[`dictionary CKDBValidateSchemaResponse {
	boolean isValid;
	string? errorMessage;
};`](/documentation/CKToolJS/CKDBValidateSchemaResponse)

The response object after validating the uploaded schema string.

[`dictionary CKDBZone {
	string zoneName;
	string canonicalName;
	string zoneType;
	boolean isDefaultZone;
	boolean? isSharable;
	boolean? isEligibleForZoneShare;
	boolean? isEligibleForHierarchicalShare;
	string? ownerRecordName;
	string? changeToken;
	boolean atomic;
};`](/documentation/CKToolJS/CKDBZone)

An object that represents a CloudKit database zone.

[`dictionary CKDBZoneId {
	string zoneName;
	string canonicalName;
	string? zoneType;
	string? ownerRecordName;
};`](/documentation/CKToolJS/CKDBZoneId)

An object that represents a CloudKit database zone identifier.

[`dictionary CKDBZoneResponse {
	CKDBZone zone;
};`](/documentation/CKToolJS/CKDBZoneResponse)

An object that represents results of fetching a zone.

[`dictionary CKDBZonesResponse {
	string? continuationToken;
	CKDBZone[] zones;
};`](/documentation/CKToolJS/CKDBZonesResponse)

An object that represents results of fetching multiple zones.

### Enumerations

[`interface CKDBPermissionType {
	const string NONE;
	const string READ_ONLY;
	const string READ_WRITE;
	const string UNKNOWN;
};`](/documentation/CKToolJS/CKDBPermissionType)

The participant’s read and write permissions.

[`interface CKDBQueryFilterType {
	const string EQUALS;
	const string NOT_EQUALS;
	const string LESS_THAN;
	const string LESS_THAN_OR_EQUALS;
	const string GREATER_THAN;
	const string GREATER_THAN_OR_EQUALS;
	const string NEAR;
	const string CONTAINS_ALL_TOKENS;
	const string IN;
	const string NOT_IN;
	const string CONTAINS_ANY_TOKENS;
	const string LIST_CONTAINS;
	const string LIST_NOT_CONTAINS;
	const string LIST_CONTAINS_ANY;
	const string LIST_NOT_CONTAINS_ANY;
	const string BEGINS_WITH;
	const string NOT_BEGINS_WITH;
	const string LIST_MEMBER_BEGINS_WITH;
	const string NOT_LIST_MEMBER_BEGINS_WITH;
	const string LIST_CONTAINS_ALL;
	const string NOT_LIST_CONTAINS_ALL;
};`](/documentation/CKToolJS/CKDBQueryFilterType)

An object that represents the type of a filter that indicates the comparison operator when applying the filter.

[`interface CKDBQuerySortOrder {
	const string ASC;
	const string DESC;
};`](/documentation/CKToolJS/CKDBQuerySortOrder)

An enumeration that represents the order to use when sorting records.

[`interface CKDBRecordReferenceAction {
	const string NONE;
	const string DELETE_SELF;
	const string VALIDATE;
};`](/documentation/CKToolJS/CKDBRecordReferenceAction)

An object that represents the action to be performed for the referenced record.

[`interface CKDBShareAcceptanceStatus {
	const string INVITED;
	const string ACCEPTED;
	const string REMOVED;
	const string UNSUBSCRIBED;
	const string UNKNOWN;
};`](/documentation/CKToolJS/CKDBShareAcceptanceStatus)

An enumeration that indicates the status of accepting the shared record.

[`interface CKDBShareParticipantType {
	const string OWNER;
	const string ADMINISTRATOR;
	const string USER;
	const string PUBLIC_USER;
	const string UNKNOWN;
};`](/documentation/CKToolJS/CKDBShareParticipantType)

An enumeration that represents the type of a share participant.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)