Arex.Command (arex v0.1.0)

Copy Markdown View Source

Write-oriented raw command helpers.

Use this module for ArcadeDB commands that are not naturally modeled by the higher-level Arex.Record, Arex.Schema, Arex.Vertex, or Arex.Edge helpers.

Results are normalized to %{count: ..., records: ...} so application code can handle common command shapes consistently even when ArcadeDB returns slightly different response bodies.

Use Arex.Command when you want explicit write statements and still want:

  • Arex option resolution
  • normalized error tuples
  • stable result normalization
  • explicit control over SQL versus SQLScript

If a write maps cleanly to a higher-level helper, prefer that helper first.

Summary

Functions

Executes a raw command using the resolved language.

Executes a SQLScript command.

Functions

run(statement, params \\ %{}, opts \\ [])

Executes a raw command using the resolved language.

The return value is normalized to %{count: ..., records: ...} so callers can handle common command shapes consistently.

Use this when you want the command language to come from resolved options rather than forcing sql or sqlscript explicitly.

sql(statement, params \\ %{}, opts \\ [])

Executes a SQL command.

This helper always forces language: "sql" regardless of any configured default language.

sqlscript(statement, params \\ %{}, opts \\ [])

Executes a SQLScript command.

Use this for multi-step write flows, explicit transactional scripts, or other SQLScript-only features.