Skip to content

Commit

Permalink
Add database operations to MilvusClient (#2152)
Browse files Browse the repository at this point in the history
Allows the following operations to be performed through the
`MilvusClient` interface:
- create_database
- drop_database
- list_databases

Resolves #2151

Signed-off-by: Ashwin Krishna Kumar <[email protected]>
  • Loading branch information
ashkrisk authored Jul 2, 2024
1 parent a5281f3 commit 9a5e4aa
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pymilvus/milvus_client/milvus_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -970,3 +970,15 @@ def list_aliases(
def using_database(self, db_name: str, **kwargs):
conn = self._get_connection()
conn.reset_db_name(db_name)

def create_database(self, db_name: str, **kwargs):
conn = self._get_connection()
conn.create_database(db_name, **kwargs)

def drop_database(self, db_name: str, **kwargs):
conn = self._get_connection()
conn.drop_database(db_name, **kwargs)

def list_databases(self, **kwargs) -> List[str]:
conn = self._get_connection()
return conn.list_database(**kwargs)

0 comments on commit 9a5e4aa

Please sign in to comment.