Skip to main content

Mastra.setStorage()

.setStorage() 方法用于为 Mastra 实例设置存储实例。此方法接受一个 MastraCompositeStore 参数。

🌐 The .setStorage() method is used to set the storage instance for the Mastra instance. This method accepts a single MastraCompositeStore parameter.

使用示例
Direct link to 使用示例

🌐 Usage example

mastra.setStorage(
new LibSQLStore({
id: 'mastra-storage',
url: ":memory:",
}),
);

参数
Direct link to 参数

🌐 Parameters

storage:

MastraCompositeStore
The storage instance to set for the Mastra instance.

返回
Direct link to 返回

🌐 Returns

此方法不返回值。

🌐 This method does not return a value.

🌐 Related