kura_ets_driver (kura_ets v0.0.1)

View Source

ETS driver impl. Receives the {kura_ets, Plan} terms emitted by kura_ets_dialect in place of SQL and executes them via kura_ets_query.

Result shape

Returns #{rows := Rows, num_rows := N, command := C} to match kura_driver_pgo's shape. Rows are maps keyed by atom field names.

Raw SQL

Anything that reaches the driver as actual SQL bytes (raw kura_repo_worker:query/3, migrations, kura's built-in many_to_many join-row persistence, optimistic-lock updates) is rejected with {error, {kura_ets, raw_sql_unsupported}} — there is no SQL engine here.

Transactions

ETS has no transactions. transaction/4 simply runs the fun: queries inside it hit the tables directly, and there is no rollback on error. The backend deliberately does not declare the transactions capability.

Summary

Functions

ensure_database(Config)

-spec ensure_database(map()) -> ok.

probe_pool(Pool)

-spec probe_pool(kura_pool:name()) -> ok | {error, term()}.

query(PoolMod, Pool, Plan, Params, Opts)

-spec query(module(), atom(), dynamic(), [term()], map()) -> dynamic().

query_on(Conn, Plan, Params, Opts)

-spec query_on(kura_pool:conn(), dynamic(), [term()], map()) -> dynamic().

transaction(PoolMod, Pool, Fun, Opts)

-spec transaction(module(), atom(), fun(() -> term()), map()) -> term().