@resistdesign/voltra
    Preparing search index...

    Type Alias DataItemDBDriver<ItemType, UniquelyIdentifyingFieldName>

    The API for a database driver.

    type DataItemDBDriver<
        ItemType extends Record<string, any>,
        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>>;
        readItemStronglyConsistent?(
            uniqueIdentifier: ItemType[UniquelyIdentifyingFieldName],
            selectedFields?: (keyof ItemType)[],
        ): Promise<Partial<ItemType>>;
        updateItem(
            uniqueIdentifier: ItemType[UniquelyIdentifyingFieldName],
            updatedItem: Partial<ItemType>,
            updateConfig?: TypeInfoORMUpdateConfig,
        ): Promise<boolean>;
    }

    Type Parameters

    • ItemType extends Record<string, any>
    • UniquelyIdentifyingFieldName extends keyof ItemType

    Implemented by

    Index

    Methods