From the course: LLM Foundations: Vector Databases for Caching and Retrieval Augmented Generation (RAG)
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Create databases and users
From the course: LLM Foundations: Vector Databases for Caching and Retrieval Augmented Generation (RAG)
Create databases and users
Having created a connection to Milvus in the previous video, let's now create a database through the SDK and then check the list of current databases. We first import the DB package from PyMilvus. This package has a list_database method that can be used to list all the databases that a given connection has access to. We get that list and print it. We don't see any databases at this point. We set the database name to course_db. If this database is not in the list of current databases, we then proceed to create the database. For this, we use the create_database method and also pass the connection ID. When a connection starts, it is usually in the context of the default database. To switch to the newly created database as the current one, we will use the using_database method. Going forward, all actions on this connection will be on the course_db database. Let's run this code now. Next, we will create a new user. We begin by using the utility package in pymilvus. The list_usernames…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.