dlex v0.4.1 Dlex.Repo
Ecto-like repository, which allows to embed the schema
defmodule Repo do
use Dlex.Repo, otp_app: :my_app, modules: [User]
end
config :my_app, Repo,
hostname: "localhost",
port: 3306
Link to this section Summary
Functions
Query all. It automatically tries to decode values inside of a query. To make it work, you
need to expand the results it like this: uid dgraph.type expand(_all_)
Alter schema for modules
Build or update lookup map from module list
Decode resulting map to a structure.
Drop everything from database. Use with caution, as it deletes everything, what you have in database.
Get by uid
The same as get/3
, but return result or raises.
Mutate data
The same as mutate/2
, but return result of sucessful operation or raises.
The same as mutate
.
Generate snapshot for running meta process
Link to this section Functions
all(conn, query, meta \\ %{lookup: %{}})
Query all. It automatically tries to decode values inside of a query. To make it work, you
need to expand the results it like this: uid dgraph.type expand(_all_)
alter_schema(conn, snapshot)
Alter schema for modules
build_lookup_map(lookup_map \\ %{}, modules)
Build or update lookup map from module list
decode(map, lookup, strict? \\ true)
Decode resulting map to a structure.
drop_all(conn)
Drop everything from database. Use with caution, as it deletes everything, what you have in database.
encode(data)
field(struct, key)
get(conn, map, uid)
Get by uid
get!(conn, meta, uid)
The same as get/3
, but return result or raises.
get_by(conn, field, name)
mutate(conn, data, opts)
Mutate data
mutate!(conn, data, opts)
The same as mutate/2
, but return result of sucessful operation or raises.
set(conn, data, opts)
The same as mutate
.
set!(conn, data, opts)
snapshot(meta)
Generate snapshot for running meta process