Basic API#

To begin your querying session, get a connection to the EvaDB using connect:

import evadb

from eva.interfaces.relational.db import EVAConnection, connect
conn = connect()

You can then use this connection to run queries:

conn.load("online_video.mp4", "youtube_video", "video").execute()
conn.query("CREATE TABLE IF NOT EXISTS youtube_video_text AS SELECT SpeechRecognizer(audio) FROM youtube_video;").execute()

Warning

It is important to call execute to run the actual query.

EvaDB uses a lazy query execution technique to improve performance. Calling conn.query("...") will only construct and not run the query. Calling conn.query("...").execute() will both construct and run the query.

EVAConnection Interface#

load(file_regex, table_name, format, **kwargs)

Load data from files into a table in the database.

query(sql_query)

Execute a SQL query.

table(table_name)

Get a EVARelation object representing a table in the database.

EVARelation Interface#

select(expr)

Projects a set of expressions and returns a new EVARelation.

execute()

Transform the relation into a result set

cross_apply(expr, alias)

Execute a expr on all the rows of the relation

filter(expr)

Filters rows using the given condition.

df()

Execute and fetch all rows as a pandas DataFrame

Advanced API#

EVAConnection Interface#

create_vector_index(index_name, table_name, ...)

Create a vector index on a table in the database.

df()

Get the result of the last executed query on the connection as a pandas DataFrame.

EVARelation Interface#

alias(alias)

Returns a new Relation with an alias set.

limit(num)

Limits the result count to the number specified.

order(order_expr)

Reorder the relation based on the order_expr

show()

Execute and fetch all rows as a pandas DataFrame

sql_query()

Get the SQL query that is equivalent to the relation