Manipulate Data in Tables, Views, and Files
Native Queries
The underlying database engine of MindsDB is MySQL. However, you can run queries native to your database engine within MindsDB.
Connect your Database to MindsDB
To run queries native to your database, you must first connect your database to MindsDB using the CREATE DATABASE
statement.
Here we connect the example_db
database, which is a PostgreSQL database.
Run Queries Native to your Database
Once we have our PostgreSQL database connected, we can run PostgreSQL-native queries.
Querying
To run PostgreSQL-native code, we must nest it within the SELECT
statement like this:
On execution, we get:
The first line (SELECT * FROM example_db
) informs MindsDB that we select from a PostgreSQL database. After that, we nest a PostgreSQL code within brackets.
Creating Views
We can create a view based on a native query.
On execution, we get: