Projects
Within MindsDB, you can create projects to store your AI models, views, or jobs.
Working with PROJECTS
Creating PROJECTS
You can create projects to store your models, making the structure like this:
Here is how you create a project:
Use lower-case letters for a project name.
Viewing PROJECTS
There are two ways you can list all your projects:
-
Use the
SHOW DATABASES
command:On execution, we get:
Please note that
mindsdb
is the default project. -
Use the
SHOW FULL DATABASES
command to get more details:On execution, we get:
To view all connected data sources, specify
type = 'data'
in theWHERE
clause.
Dropping PROJECTS
Here is how you can remove a project:
On execution, we get:
Cannot Drop a Project
Please note that if your project stores at least one object, it cannot be removed. In this case, you should first drop all the jobs and tables, such as models and views, belonging to this project, and then, you can remove the project. Please see the Example section for details.
Working with MODELS
Creating MODELS
Here is how you create a model within the project:
On execution, we get:
Viewing MODELS
To see all the models from all projects, run the command below.
On execution, we get:
And if you want to list all the models from a defined project, run either of the commands below.
On execution, we get:
Here is how to run a detailed search:
On execution, we get:
Dropping MODELS
To drop a model, run this command:
On execution, we get:
Working with MODELS_VERSION
There is a models_versions
table for each project that stores all the versions of your models.
Here is how to query for all model versions from all the projects:
On execution, we get:
Example
If there is more training data available, you don’t need to recreate your model. Instead, use the RETRAIN
command.
After the retraining process completes, here is what you get:
On execution, we get:
Now, the model_b
model has two records storing its two versions, out of which one is active.
You can also query for model versions of a project using this SELECT
statement:
On execution, we get:
Working with TABLES
The models that you create with the CREATE MODEL
command are simple tables within a project. Therefore, you can use the SHOW [FULL] TABLES
commands to query for them.
Here is how to query for tables from all databases/projects/schemas:
On execution, we get:
Default Tables
Please note that each project contains four tables by default. These are the models, models_versions , jobs and jobs_history table.
There are also shortcut commands to query for the tables:
-
Querying for tables from the default project:
On execution, we get:
Or, to get more details:
On execution, we get:
How to Set a Default Project
The default project is set to
mindsdb
. If you want to change it, run theUSE project_name;
command. -
Querying for tables from a defined project:
On execution, we get:
Or, to get more details:
On execution, we get:
Example
Let’s create a project.
To verify that the project was created successfully, let’s run the command below to select all databases, including connected data sources and projects.
On execution, we get:
Please note that information_schema
is the system database, mindsdb
is the default project, and files
is the database to store all uploaded files. For more information, please visit our docs on MindsDB default structure.
Now we create a model within the project.
Also, let’s create a view.
Here is what we have in the my_project
project.
On execution, we get:
Let’s try to delete our project.
On execution, we get:
Users should remove all project content before dropping a project.
Now we can proceed to drop a project.
Next Steps
Below are the links to help you explore further.