From baf7bc0d7a5986a4923aa5814aff548721e0d2ed Mon Sep 17 00:00:00 2001 From: Diego Aguiar Date: Thu, 18 Dec 2025 17:54:59 -0700 Subject: [PATCH] [Store] Add `$options` argument to `ManagedStoreInterface::drop()` --- src/store/src/Bridge/Cache/Store.php | 2 +- src/store/src/Bridge/ClickHouse/Store.php | 2 +- src/store/src/Bridge/Cloudflare/Store.php | 2 +- src/store/src/Bridge/Elasticsearch/Store.php | 2 +- src/store/src/Bridge/ManticoreSearch/Store.php | 2 +- src/store/src/Bridge/MariaDb/Store.php | 2 +- src/store/src/Bridge/Meilisearch/Store.php | 2 +- src/store/src/Bridge/Milvus/Store.php | 2 +- src/store/src/Bridge/MongoDb/Store.php | 2 +- src/store/src/Bridge/Neo4j/Store.php | 2 +- src/store/src/Bridge/OpenSearch/Store.php | 2 +- src/store/src/Bridge/Postgres/Store.php | 2 +- src/store/src/Bridge/Qdrant/Store.php | 2 +- src/store/src/Bridge/Redis/Store.php | 2 +- src/store/src/Bridge/SurrealDb/Store.php | 2 +- src/store/src/Bridge/Typesense/Store.php | 2 +- src/store/src/Bridge/Weaviate/Store.php | 2 +- src/store/src/InMemory/Store.php | 2 +- src/store/src/ManagedStoreInterface.php | 5 ++++- 19 files changed, 22 insertions(+), 19 deletions(-) diff --git a/src/store/src/Bridge/Cache/Store.php b/src/store/src/Bridge/Cache/Store.php index ce6e12a99..c994531c0 100644 --- a/src/store/src/Bridge/Cache/Store.php +++ b/src/store/src/Bridge/Cache/Store.php @@ -91,7 +91,7 @@ public function query(Vector $vector, array $options = []): iterable yield from $this->distanceCalculator->calculate($vectorDocuments, $vector, $options['maxItems'] ?? null); } - public function drop(): void + public function drop(array $options = []): void { $this->cache->clear(); } diff --git a/src/store/src/Bridge/ClickHouse/Store.php b/src/store/src/Bridge/ClickHouse/Store.php index 1b5a06623..dc2b783bc 100644 --- a/src/store/src/Bridge/ClickHouse/Store.php +++ b/src/store/src/Bridge/ClickHouse/Store.php @@ -48,7 +48,7 @@ public function setup(array $options = []): void $this->execute('POST', $sql); } - public function drop(): void + public function drop(array $options = []): void { $this->execute('POST', 'DROP TABLE IF EXISTS {{ table }}'); } diff --git a/src/store/src/Bridge/Cloudflare/Store.php b/src/store/src/Bridge/Cloudflare/Store.php index 446c161ba..8cd1e5943 100644 --- a/src/store/src/Bridge/Cloudflare/Store.php +++ b/src/store/src/Bridge/Cloudflare/Store.php @@ -52,7 +52,7 @@ public function setup(array $options = []): void ]); } - public function drop(): void + public function drop(array $options = []): void { $this->request('DELETE', \sprintf('vectorize/v2/indexes/%s', $this->index)); } diff --git a/src/store/src/Bridge/Elasticsearch/Store.php b/src/store/src/Bridge/Elasticsearch/Store.php index a5798d6f2..aed051f85 100644 --- a/src/store/src/Bridge/Elasticsearch/Store.php +++ b/src/store/src/Bridge/Elasticsearch/Store.php @@ -54,7 +54,7 @@ public function setup(array $options = []): void ]); } - public function drop(): void + public function drop(array $options = []): void { $indexExistResponse = $this->httpClient->request('HEAD', \sprintf('%s/%s', $this->endpoint, $this->indexName)); diff --git a/src/store/src/Bridge/ManticoreSearch/Store.php b/src/store/src/Bridge/ManticoreSearch/Store.php index 1583d6e4f..6875b8d4b 100644 --- a/src/store/src/Bridge/ManticoreSearch/Store.php +++ b/src/store/src/Bridge/ManticoreSearch/Store.php @@ -50,7 +50,7 @@ public function setup(array $options = []): void )); } - public function drop(): void + public function drop(array $options = []): void { $this->request('cli', \sprintf('DROP TABLE %s', $this->table)); } diff --git a/src/store/src/Bridge/MariaDb/Store.php b/src/store/src/Bridge/MariaDb/Store.php index 0219fe8f1..3c9668ad1 100644 --- a/src/store/src/Bridge/MariaDb/Store.php +++ b/src/store/src/Bridge/MariaDb/Store.php @@ -76,7 +76,7 @@ public function setup(array $options = []): void ); } - public function drop(): void + public function drop(array $options = []): void { $this->connection->exec(\sprintf('DROP TABLE IF EXISTS %s', $this->tableName)); } diff --git a/src/store/src/Bridge/Meilisearch/Store.php b/src/store/src/Bridge/Meilisearch/Store.php index 6f59c7e81..4a3ce409e 100644 --- a/src/store/src/Bridge/Meilisearch/Store.php +++ b/src/store/src/Bridge/Meilisearch/Store.php @@ -101,7 +101,7 @@ public function query(Vector $vector, array $options = []): iterable } } - public function drop(): void + public function drop(array $options = []): void { $this->request('DELETE', \sprintf('indexes/%s', $this->indexName), []); } diff --git a/src/store/src/Bridge/Milvus/Store.php b/src/store/src/Bridge/Milvus/Store.php index 13dc16bc9..bd9549407 100644 --- a/src/store/src/Bridge/Milvus/Store.php +++ b/src/store/src/Bridge/Milvus/Store.php @@ -122,7 +122,7 @@ public function query(Vector $vector, array $options = []): iterable } } - public function drop(): void + public function drop(array $options = []): void { $this->request('POST', 'v2/vectordb/databases/drop', [ 'dbName' => $this->database, diff --git a/src/store/src/Bridge/MongoDb/Store.php b/src/store/src/Bridge/MongoDb/Store.php index 09d1c0b46..1d407c2d6 100644 --- a/src/store/src/Bridge/MongoDb/Store.php +++ b/src/store/src/Bridge/MongoDb/Store.php @@ -99,7 +99,7 @@ public function setup(array $options = []): void } } - public function drop(): void + public function drop(array $options = []): void { $this->getCollection()->drop(); } diff --git a/src/store/src/Bridge/Neo4j/Store.php b/src/store/src/Bridge/Neo4j/Store.php index 1662ddee2..8007e450d 100644 --- a/src/store/src/Bridge/Neo4j/Store.php +++ b/src/store/src/Bridge/Neo4j/Store.php @@ -79,7 +79,7 @@ public function query(Vector $vector, array $options = []): iterable } } - public function drop(): void + public function drop(array $options = []): void { $this->request('POST', \sprintf('db/%s/query/v2', $this->databaseName), [ 'statement' => 'MATCH (n) DETACH DELETE n', diff --git a/src/store/src/Bridge/OpenSearch/Store.php b/src/store/src/Bridge/OpenSearch/Store.php index 4fc658e8b..af9228b81 100644 --- a/src/store/src/Bridge/OpenSearch/Store.php +++ b/src/store/src/Bridge/OpenSearch/Store.php @@ -60,7 +60,7 @@ public function setup(array $options = []): void ]); } - public function drop(): void + public function drop(array $options = []): void { $indexExistResponse = $this->httpClient->request('HEAD', \sprintf('%s/%s', $this->endpoint, $this->indexName)); diff --git a/src/store/src/Bridge/Postgres/Store.php b/src/store/src/Bridge/Postgres/Store.php index 9294ca2ac..92001d04b 100644 --- a/src/store/src/Bridge/Postgres/Store.php +++ b/src/store/src/Bridge/Postgres/Store.php @@ -75,7 +75,7 @@ public function setup(array $options = []): void ); } - public function drop(): void + public function drop(array $options = []): void { $this->connection->exec(\sprintf('DROP TABLE IF EXISTS %s', $this->tableName)); } diff --git a/src/store/src/Bridge/Qdrant/Store.php b/src/store/src/Bridge/Qdrant/Store.php index 6d6e4bbbb..deb4d760c 100644 --- a/src/store/src/Bridge/Qdrant/Store.php +++ b/src/store/src/Bridge/Qdrant/Store.php @@ -103,7 +103,7 @@ public function query(Vector $vector, array $options = []): iterable } } - public function drop(): void + public function drop(array $options = []): void { $this->request('DELETE', \sprintf('collections/%s', $this->collectionName)); } diff --git a/src/store/src/Bridge/Redis/Store.php b/src/store/src/Bridge/Redis/Store.php index 85b43aa8e..e15c6569a 100644 --- a/src/store/src/Bridge/Redis/Store.php +++ b/src/store/src/Bridge/Redis/Store.php @@ -67,7 +67,7 @@ public function setup(array $options = []): void $this->redis->clearLastError(); } - public function drop(): void + public function drop(array $options = []): void { try { $this->redis->rawCommand('FT.DROPINDEX', $this->indexName); diff --git a/src/store/src/Bridge/SurrealDb/Store.php b/src/store/src/Bridge/SurrealDb/Store.php index 8c5da67c6..660edc95a 100644 --- a/src/store/src/Bridge/SurrealDb/Store.php +++ b/src/store/src/Bridge/SurrealDb/Store.php @@ -75,7 +75,7 @@ public function query(Vector $vector, array $options = []): iterable } } - public function drop(): void + public function drop(array $options = []): void { $this->authenticate(); diff --git a/src/store/src/Bridge/Typesense/Store.php b/src/store/src/Bridge/Typesense/Store.php index f501ef99b..16c44ca4d 100644 --- a/src/store/src/Bridge/Typesense/Store.php +++ b/src/store/src/Bridge/Typesense/Store.php @@ -86,7 +86,7 @@ public function query(Vector $vector, array $options = []): iterable } } - public function drop(): void + public function drop(array $options = []): void { $this->request('DELETE', \sprintf('collections/%s', $this->collection), []); } diff --git a/src/store/src/Bridge/Weaviate/Store.php b/src/store/src/Bridge/Weaviate/Store.php index 07efcccd2..787a1fb80 100644 --- a/src/store/src/Bridge/Weaviate/Store.php +++ b/src/store/src/Bridge/Weaviate/Store.php @@ -78,7 +78,7 @@ public function query(Vector $vector, array $options = []): iterable } } - public function drop(): void + public function drop(array $options = []): void { $this->request('DELETE', \sprintf('v1/schema/%s', $this->collection), []); } diff --git a/src/store/src/InMemory/Store.php b/src/store/src/InMemory/Store.php index f6eca29da..a46ad085f 100644 --- a/src/store/src/InMemory/Store.php +++ b/src/store/src/InMemory/Store.php @@ -65,7 +65,7 @@ public function query(Vector $vector, array $options = []): iterable yield from $this->distanceCalculator->calculate($documents, $vector, $options['maxItems'] ?? null); } - public function drop(): void + public function drop(array $options = []): void { $this->documents = []; } diff --git a/src/store/src/ManagedStoreInterface.php b/src/store/src/ManagedStoreInterface.php index 3a2f3c4b5..ac6399521 100644 --- a/src/store/src/ManagedStoreInterface.php +++ b/src/store/src/ManagedStoreInterface.php @@ -21,5 +21,8 @@ interface ManagedStoreInterface */ public function setup(array $options = []): void; - public function drop(): void; + /** + * @param array $options + */ + public function drop(array $options = []): void; }