Classes

The following classes are available globally.

  • A singleton class responsible for managing and providing access to document collections. The CollectionCatalog class maintains a registry of collections, allowing for centralized management and retrieval of DocumentCollection instances. It is designed as a singleton to ensure a single, globally accessible instance throughout the application.

    See more

    Declaration

    Swift

    public class CollectionCatalog
  • A class representing a collection of documents within the database.

    The DocumentCollection class 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.
    See more

    Declaration

    Swift

    public class DocumentCollection
  • Represents a shard in the database, which is a unit of data storage and management.

    A Shard contains 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.
    See more

    Declaration

    Swift

    public class Shard
  • The ShardManager class is responsible for managing a collection of Shard objects. It provides functionality for storing, retrieving, and managing shards, as well as handling file-related configurations and compression methods.

    • Properties:
      • shards: A dictionary mapping String keys to Shard objects, 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.
    See more

    Declaration

    Swift

    public class ShardManager
  • 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.
    See more

    Declaration

    Swift

    public class NyaruDB2