ex_orient v1.4.0 ExOrient.DB

MarcoPolo ExOrientDB wrapper that provides a clean syntax for queries. This module simply routes SQL commands to the correct submodule, providing the ability to call all commands through ExOrient.DB.

Summary

Functions

alter(opts \\ [])
command(query)

Execute a raw query with MarcoPolo and return the response.

ExOrient.DB.command("SELECT FROM ProgrammingLanguage")
# [%MarcoPolo.Document{class: "ProgrammingLanguage", fields: _, rid: _, version: _} | _rest]

Only use this function directly if you need the power of a raw query. Be sure to use the params argument if you need to bind variables:

ExOrient.DB.command("SELECT FROM ProgrammingLanguage WHERE name = :name", params: %{name: "Elixir"})
command(query, list)
create(opts \\ [])
delete(opts \\ [])
drop(opts \\ [])
exec(arg)

An alias for command/1

insert(opts)

See ExOrient.DB.CRUD.insert/1.

rebuild(opts)

See ExOrient.DB.Indexes.rebuild/1.

script(type, str)

Execute a server-side script. type can be either "SQL" or "Javascript". str is the string of the script you want to run. Example:

DB.script("SQL", "begin; let v = create vertex V set name = 'test'; commit; return $v")
{:ok, %MarcoPolo.Document{fields: %{"name" => "test"}}}
select(field)

See ExOrient.DB.CRUD.select/1.

select(field, opts)

See ExOrient.DB.CRUD.select/2.

truncate(opts)

See ExOrient.DB.CRUD.truncate/1.

update(obj, opts)

See ExOrient.DB.CRUD.update/2.