Elixir client for FalkorDB 4.18.3 built on top of Redix. V1 supports single-node and sentinel topologies.
- Single-node / standalone FalkorDB (
mode: :single) via URL or host/port. - Sentinel-managed FalkorDB (
mode: :sentinel) via sentinel endpoints and group name. - Current V1 scope does not include Redis Cluster mode.
Add :falkordb to your dependencies:
def deps do
[
{:falkordb, "~> 0.1.0"}
]
end{:ok, db} =
FalkorDB.connect(
mode: :single,
url: "redis://127.0.0.1:6379"
)
graph = FalkorDB.select_graph(db, "social")
{:ok, _} = FalkorDB.Graph.query(graph, "CREATE (:Person {name: 'Alice'})")
{:ok, result} = FalkorDB.Graph.ro_query(graph, "MATCH (n:Person) RETURN n.name AS name")
IO.inspect(result.data)
:ok = FalkorDB.stop(db){:ok, db} =
FalkorDB.connect(
mode: :sentinel,
group: "mymaster",
sentinels: [{"127.0.0.1", 26_379}, {"127.0.0.1", 26_380}]
)The client includes wrappers for the FalkorDB 4.18.3 module command surface:
- Query:
GRAPH.QUERY,GRAPH.RO_QUERY,GRAPH.EXPLAIN,GRAPH.PROFILE - Graph ops:
GRAPH.DELETE,GRAPH.COPY,GRAPH.RESTORE,GRAPH.EFFECT,GRAPH.BULK - Schema/admin:
GRAPH.CONSTRAINT,GRAPH.SLOWLOG,GRAPH.MEMORY,GRAPH.CONFIG,GRAPH.LIST,GRAPH.INFO - Advanced/admin:
GRAPH.DEBUG,GRAPH.UDFCompact parsing includes graph entities and temporal types (datetime,date,time,duration).
Additional API behavior:
FalkorDB.config_set/2supports setting multiple options in one call via keyword lists or maps, matchingGRAPH.CONFIG SET <NAME> <VALUE> [<NAME> <VALUE> ...].FalkorDB.Graph.explain/3andFalkorDB.Graph.profile/3accept the same query option style asquery/3(for exampletimeoutandversion).FalkorDB.Graph.memory_usage/2normalizes responses into a stable map shape across RESP2/RESP3.
Test coverage includes both fast unit tests and opt-in integration tests:
- Unit tests cover command dispatch/building, query parameter serialization, compact parser behavior, and schema cache metadata resolution paths.
- Standalone integration tests cover end-to-end query flow (nodes/edges/paths), temporal values, UDF lifecycle, and indexing/search flows including vector, full-text, and geospatial queries.
- Sentinel integration tests cover connecting through sentinel and executing graph commands in sentinel mode.
Run local checks:
mix checkmix check runs:
mix format --check-formattedmix credo --strictmix test
Integration tests are opt-in and disabled by default. To run them:
FALKORDB_RUN_INTEGRATION=1 mix testEnvironment:
FALKORDB_URL(default:redis://127.0.0.1:6379)FALKORDB_TEST_GRAPH(default:elixir-test) Coverage highlights:- graph CRUD/query execution and compact parsing
- temporal values (
date,time,datetime,duration) - UDF load/list/query/delete/flush flows
- index creation and search (
VECTOR,FULLTEXT, geospatialRANGE)
Environment:
FALKORDB_SENTINELS(comma-separatedhost:port, example:127.0.0.1:26379,127.0.0.1:26380)FALKORDB_SENTINEL_GROUP(default:mymaster) Coverage highlights:- sentinel discovery and connection
- query/list command flow against sentinel-managed deployment
Runnable scripts are available under examples/:
examples/quickstart.exsexamples/sentinel.exs
This repo includes:
- CI workflow:
.github/workflows/ci.yml - Hex release workflow:
.github/workflows/release.ymlSetHEX_API_KEYin repository secrets before publishing tags (for examplev0.1.0).