@mastra/lance 0.0.0-main-test-05-11-2025-2-20251106011400 → 0.0.0-main-test-05-11-2025-2-20251106020936
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -3
- package/dist/index.cjs +12 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -10
- package/dist/index.js.map +1 -1
- package/dist/storage/index.d.ts +6 -4
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/vector/index.d.ts +3 -1
- package/dist/vector/index.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1685,6 +1685,8 @@ var LanceStorage = class _LanceStorage extends MastraStorage {
|
|
|
1685
1685
|
lanceClient;
|
|
1686
1686
|
/**
|
|
1687
1687
|
* Creates a new instance of LanceStorage
|
|
1688
|
+
* @param id The unique identifier for this storage instance
|
|
1689
|
+
* @param name The name for this storage instance
|
|
1688
1690
|
* @param uri The URI to connect to LanceDB
|
|
1689
1691
|
* @param options connection options
|
|
1690
1692
|
*
|
|
@@ -1692,21 +1694,21 @@ var LanceStorage = class _LanceStorage extends MastraStorage {
|
|
|
1692
1694
|
*
|
|
1693
1695
|
* Connect to a local database
|
|
1694
1696
|
* ```ts
|
|
1695
|
-
* const store = await LanceStorage.create('/path/to/db');
|
|
1697
|
+
* const store = await LanceStorage.create('my-storage-id', 'MyStorage', '/path/to/db');
|
|
1696
1698
|
* ```
|
|
1697
1699
|
*
|
|
1698
1700
|
* Connect to a LanceDB cloud database
|
|
1699
1701
|
* ```ts
|
|
1700
|
-
* const store = await LanceStorage.create('db://host:port');
|
|
1702
|
+
* const store = await LanceStorage.create('my-storage-id', 'MyStorage', 'db://host:port');
|
|
1701
1703
|
* ```
|
|
1702
1704
|
*
|
|
1703
1705
|
* Connect to a cloud database
|
|
1704
1706
|
* ```ts
|
|
1705
|
-
* const store = await LanceStorage.create('s3://bucket/db', { storageOptions: { timeout: '60s' } });
|
|
1707
|
+
* const store = await LanceStorage.create('my-storage-id', 'MyStorage', 's3://bucket/db', { storageOptions: { timeout: '60s' } });
|
|
1706
1708
|
* ```
|
|
1707
1709
|
*/
|
|
1708
|
-
static async create(name, uri, options) {
|
|
1709
|
-
const instance = new _LanceStorage(name);
|
|
1710
|
+
static async create(id, name, uri, options) {
|
|
1711
|
+
const instance = new _LanceStorage(id, name);
|
|
1710
1712
|
try {
|
|
1711
1713
|
instance.lanceClient = await connect(uri, options);
|
|
1712
1714
|
const operations = new StoreOperationsLance({ client: instance.lanceClient });
|
|
@@ -1734,8 +1736,8 @@ var LanceStorage = class _LanceStorage extends MastraStorage {
|
|
|
1734
1736
|
* @internal
|
|
1735
1737
|
* Private constructor to enforce using the create factory method
|
|
1736
1738
|
*/
|
|
1737
|
-
constructor(name) {
|
|
1738
|
-
super({ name });
|
|
1739
|
+
constructor(id, name) {
|
|
1740
|
+
super({ id, name });
|
|
1739
1741
|
const operations = new StoreOperationsLance({ client: this.lanceClient });
|
|
1740
1742
|
this.stores = {
|
|
1741
1743
|
operations: new StoreOperationsLance({ client: this.lanceClient }),
|
|
@@ -2291,7 +2293,7 @@ var LanceVectorStore = class _LanceVectorStore extends MastraVector {
|
|
|
2291
2293
|
* ```
|
|
2292
2294
|
*/
|
|
2293
2295
|
static async create(uri, options) {
|
|
2294
|
-
const instance = new _LanceVectorStore();
|
|
2296
|
+
const instance = new _LanceVectorStore(options?.id || crypto.randomUUID());
|
|
2295
2297
|
try {
|
|
2296
2298
|
instance.lanceClient = await connect(uri, options);
|
|
2297
2299
|
return instance;
|
|
@@ -2311,8 +2313,8 @@ var LanceVectorStore = class _LanceVectorStore extends MastraVector {
|
|
|
2311
2313
|
* @internal
|
|
2312
2314
|
* Private constructor to enforce using the create factory method
|
|
2313
2315
|
*/
|
|
2314
|
-
constructor() {
|
|
2315
|
-
super();
|
|
2316
|
+
constructor(id) {
|
|
2317
|
+
super({ id });
|
|
2316
2318
|
}
|
|
2317
2319
|
close() {
|
|
2318
2320
|
if (this.lanceClient) {
|