Connect to Data Sources#

EvaDB supports a wide range of data sources including SQL database systems, object stores, and vector database systems.

Connect to an Existing SQL Database System#

  1. Use the CREATE DATABASE statement to connect to an existing SQL database server. For example, here is the SQL command to connect EvaDB with a locally running PostgreSQL database server running on port 5432.

CREATE DATABASE restaurant_reviews
WITH ENGINE = 'postgres',
PARAMETERS = {
    "user": "eva",
    "password": "password",
    "host": "localhost",
    "port": "5432",
    "database": "restaurant_reviews"
};

For quick prototyping, you can use an embedded SQLite database. Here, the SQLite database file is called evadb.db.

CREATE DATABASE restaurant_reviews
WITH ENGINE = 'sqlite',
PARAMETERS = {
    "database": "evadb.db"
};

Note

Go over the CREATE DATABASE statement for more details. The Databases page lists all the database systems that EvaDB currently supports.

  1. Preview the data using SELECT

You can now preview the data stored in the food_review table in the restaurant_reviews database with a SELECT statement.

SELECT * FROM restaurant_reviews.food_review;
  1. Run native queries inside the connected database with USE

You can also run native queries directly inside the connected database system with the USE statement.

USE restaurant_reviews {
    INSERT INTO food_review (name, review)
    VALUES (
        'Customer 1',
        'I ordered fried rice but it is too salty.'
    )
};

Connect to Object Store#

EvaDB supports diverse types of unstructured data (e.g., PDFs, videos). You can load a video from an S3 cloud bucket into EvaDB using the LOAD statement.

LOAD VIDEO 's3://bucket/eva_videos/mnist.mp4' INTO MNISTVid;

Note

Go over the LOAD VIDEO statement for more details on the types of unstructured data that EvaDB supports.

Connect to Local Filesystem#

You can load a collection of images obtained from Reddit from the local filesystem into EvaDB using the LOAD IMAGE statement.

LOAD IMAGE 'reddit-images/*.jpg' INTO reddit_dataset;

Connect to Vector Database System#

Vector database systems are useful for querying unstructured data. A vector index contains the vectors (embeddings) generated by processing the unstructured data using a feature extractor function.

You can use the CREATE INDEX statement to connect to an existing vector database system.

CREATE INDEX index_name ON table_name (data) USING FAISS;

Note

Go over the CREATE INDEX statement for more details. The Vector Databases page lists all the vector database systems that EvaDB currently supports.




Language Models (🦙) and Databases

Language Models (🦙) and Databases#