Skip to main content

IFluidDataStoreContext Interface

Extension to IFluidParentContext specifically for IDataStores.

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/runtime-definitions/legacy.

For more information about our API support guarantees, see here.

Signature

export interface IFluidDataStoreContext extends IFluidParentContext

Extends: IFluidParentContext

Remarks

This context is provided to the implementation of IFluidDataStoreChannel which powers the datastore.

Properties

PropertyAlertsModifiersTypeDescription
baseSnapshotBetareadonlyISnapshotTree | undefined
createPropsDeprecated, Betaoptional, readonlyany
idBetareadonlystring
isLocalDataStoreBetareadonlybooleanA data store created by a client, is a local data store for that client. Also, when a detached container loads from a snapshot, all the data stores are treated as local data stores because at that stage the container still doesn't exists in storage and so the data store couldn't have been created by any other client. Value of this never changes even after the data store is attached. As implementer of data store runtime, you can use this property to check that this data store belongs to this client and hence implement any scenario based on that.
packagePathBetareadonlyPackagePathThe PackagePath of the data store as per the package factory.

Methods

MethodAlertsModifiersReturn TypeDescription
createChildDataStore(childFactory)BetaoptionalReturnType<Exclude<T["createDataStore"], undefined>>

Synchronously creates a detached child data store.

The createChildDataStore method allows for the synchronous creation of a detached child data store. This is particularly useful in scenarios where immediate availability of the child data store is required, such as during the initialization of a parent data store, or when creation is in response to synchronous user input.

In order for this function to succeed: 1. The parent data store's factory must also be an IFluidDataStoreRegistry. 2. The parent data store's registry must include the same instance as the provided child factory. 3. The parent data store's registry must synchronously provide the child factory via the getSync method. 4. The child factory must implement the createDataStore method.

These invariants ensure that the child data store can also be created by a remote client running the same code as this client.

getBaseGCDetails()Deprecated, BetaPromise<IGarbageCollectionDetailsBase>

Property Details

baseSnapshot

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

readonly baseSnapshot: ISnapshotTree | undefined;

Type: ISnapshotTree | undefined

createProps

This API is deprecated and will be removed in a future release.

0.16 Issue #1635, #3631

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

readonly createProps?: any;

Type: any

id

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

readonly id: string;

Type: string

isLocalDataStore

A data store created by a client, is a local data store for that client. Also, when a detached container loads from a snapshot, all the data stores are treated as local data stores because at that stage the container still doesn't exists in storage and so the data store couldn't have been created by any other client. Value of this never changes even after the data store is attached. As implementer of data store runtime, you can use this property to check that this data store belongs to this client and hence implement any scenario based on that.

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

readonly isLocalDataStore: boolean;

Type: boolean

packagePath

The PackagePath of the data store as per the package factory.

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

readonly packagePath: PackagePath;

Type: PackagePath

Remarks

This defines what IFluidDataStoreFactory would be used to create the entryPoint of the IDataStore.

Method Details

createChildDataStore

Synchronously creates a detached child data store.

The createChildDataStore method allows for the synchronous creation of a detached child data store. This is particularly useful in scenarios where immediate availability of the child data store is required, such as during the initialization of a parent data store, or when creation is in response to synchronous user input.

In order for this function to succeed: 1. The parent data store's factory must also be an IFluidDataStoreRegistry. 2. The parent data store's registry must include the same instance as the provided child factory. 3. The parent data store's registry must synchronously provide the child factory via the getSync method. 4. The child factory must implement the createDataStore method.

These invariants ensure that the child data store can also be created by a remote client running the same code as this client.

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

createChildDataStore?<T extends IFluidDataStoreFactory>(childFactory: T): ReturnType<Exclude<T["createDataStore"], undefined>>;
Type Parameters
ParameterConstraintDescription
TIFluidDataStoreFactory

Parameters

ParameterTypeDescription
childFactoryTThe factory of the data store to be created.

Returns

The created data store channel.

Return type: ReturnType<Exclude<T["createDataStore"], undefined>>

getBaseGCDetails

This API is deprecated and will be removed in a future release.

The functionality to get base GC details has been moved to summarizer node.

Returns the GC details in the initial summary of this data store. This is used to initialize the data store and its children with the GC details from the previous summary.

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;

Returns

Return type: Promise<IGarbageCollectionDetailsBase>