Classes
The following classes are available globally.
-
A singleton class responsible for managing and providing access to document collections. The
See moreCollectionCatalogclass maintains a registry of collections, allowing for centralized management and retrieval ofDocumentCollectioninstances. It is designed as a singleton to ensure a single, globally accessible instance throughout the application.Declaration
Swift
public class CollectionCatalog -
A class representing a collection of documents within the database.
The
DocumentCollectionclass is responsible for managing the documents in a specific collection, including their metadata, storage, and statistics.- Properties:
metadata: Metadata associated with the collection, such as its name and configuration.storage: The storage engine responsible for persisting the documents in the collection.statsEngine: The statistics engine responsible for tracking and managing collection statistics.
Declaration
Swift
public class DocumentCollection -
Represents a shard in the database, which is a unit of data storage and management.
A
Shardcontains metadata, a unique identifier, and configuration details such as compression and file protection settings. It also includes a cache for storing documents.- Properties:
id: A unique identifier for the shard.url: The file URL where the shard is stored.metadata: Metadata associated with the shard, such as its state and configuration.compressionMethod: The method used to compress data within the shard.fileProtectionType: The file protection level applied to the shard’s storage.documentCache: An in-memory cache for storing documents, keyed by their identifiers.
Declaration
Swift
public class Shard - Properties:
-
The
ShardManagerclass is responsible for managing a collection ofShardobjects. It provides functionality for storing, retrieving, and managing shards, as well as handling file-related configurations and compression methods.- Properties:
shards: A dictionary mappingStringkeys toShardobjects, representing the managed shards.baseURL: The base URL where shard files are stored.compressionMethod: The method used for compressing shard data.fileProtectionType: The file protection type applied to shard files.autoMergeTask: An optional asynchronous task for automatically merging shards.
Declaration
Swift
public class ShardManager - Properties:
-
A class representing the NyaruDB2 database system.
This class provides the core functionality for managing collections, storage, indexing, and statistics within the database.
- Properties:
storage: The storage engine responsible for handling data persistence.indexManager: The index manager responsible for managing indexes for efficient data retrieval.statsEngine: A private engine for tracking and managing database statistics.collections: A private dictionary mapping collection names to their respective document collections.
Declaration
Swift
public class NyaruDB2 - Properties:
View on GitHub
Classes Reference