@resistdesign/voltra
    Preparing search index...

    Type Alias DataItemDBDriver<ItemType, UniquelyIdentifyingFieldName>

    The API for a database driver.

    type DataItemDBDriver<
        ItemType extends TypeInfoDataItem,
        UniquelyIdentifyingFieldName extends keyof ItemType,
    > = {
        createItem: (
            newItem: Partial<Omit<ItemType, UniquelyIdentifyingFieldName>>,
        ) => Promise<ItemType[UniquelyIdentifyingFieldName]>;
        deleteItem: (
            uniqueIdentifier: ItemType[UniquelyIdentifyingFieldName],
        ) => Promise<boolean>;
        listItems: (
            config: ListItemsConfig,
            selectedFields?: (keyof ItemType)[],
        ) => Promise<ListItemsResults<Partial<ItemType>>>;
        readItem: (
            uniqueIdentifier: ItemType[UniquelyIdentifyingFieldName],
            selectedFields?: (keyof ItemType)[],
        ) => Promise<Partial<ItemType>>;
        updateItem: (
            uniqueIdentifier: ItemType[UniquelyIdentifyingFieldName],
            updatedItem: Partial<ItemType>,
        ) => Promise<boolean>;
    }

    Type Parameters

    • ItemType extends TypeInfoDataItem
    • UniquelyIdentifyingFieldName extends keyof ItemType

    Implemented by

    Index

    Properties

    createItem: (
        newItem: Partial<Omit<ItemType, UniquelyIdentifyingFieldName>>,
    ) => Promise<ItemType[UniquelyIdentifyingFieldName]>

    Create a new item in the data store.

    Type Declaration

    deleteItem: (
        uniqueIdentifier: ItemType[UniquelyIdentifyingFieldName],
    ) => Promise<boolean>

    Delete an item from the data store.

    Type Declaration

    listItems: (
        config: ListItemsConfig,
        selectedFields?: (keyof ItemType)[],
    ) => Promise<ListItemsResults<Partial<ItemType>>>

    List items from the data store.

    Type Declaration

      • (
            config: ListItemsConfig,
            selectedFields?: (keyof ItemType)[],
        ): Promise<ListItemsResults<Partial<ItemType>>>
      • Parameters

        • config: ListItemsConfig

          List configuration and criteria.

        • OptionalselectedFields: (keyof ItemType)[]

          Optional fields to select from each item.

        Returns Promise<ListItemsResults<Partial<ItemType>>>

        List results with items and cursor.

    readItem: (
        uniqueIdentifier: ItemType[UniquelyIdentifyingFieldName],
        selectedFields?: (keyof ItemType)[],
    ) => Promise<Partial<ItemType>>

    Read an item from the data store.

    Type Declaration

    updateItem: (
        uniqueIdentifier: ItemType[UniquelyIdentifyingFieldName],
        updatedItem: Partial<ItemType>,
    ) => Promise<boolean>

    Update an item in the data store.

    Type Declaration