Hey @zackattackz great questions! XTDB’s transaction model is inherently non-interactive, but you can submit an atomically committed group of statements over HTTP (the xtsql.py
demo script doesn’t make use of this, but the OpenAPI endpoint supports it) or via the existing client drivers.
However, we also have a ‘pgwire’ Postgres wire protocol server module which at least partially implements the SQL you are looking for. This module will soon be promoted into the core and documented as a first-class means of interacting with XTDB (where previously it has existed for demonstration purposes only, e.g. it currently only supports returning JSON types).
You can try XTDB like this already using the regular Docker container if you connect to the default Postgres port (5432), or you can see it in action using this public demo endpoint to understand how it works:
~ psql -h pg.xtdb.com
psql (16.2, server 14)
Type "help" for help.
jdt=> select * from foo;
--
(0 rows)
jdt=> begin read write;
BEGIN
jdt=*> insert into foo (xt$id, bar) values (1, 'baz');
INSERT 0 0
jdt=*> select * from foo;
ERROR: queries are unsupported in a READ WRITE transaction
jdt=!> rollback;
ROLLBACK
jdt=> select * from foo;
--
(0 rows)
jdt=> begin read write;
BEGIN
jdt=*> insert into foo (xt$id, bar) values (1, 'baz');
INSERT 0 0
jdt=*> commit;
COMMIT
jdt=> select * from foo;
xt$id | bar
-------+-------
1 | "baz"
(1 row)
jdt=>
^ this is actually connecting to a real, temporary XTDB instance.
Also note that transactions are automatic/implicit if you don’t use an explicit begin read write; <...> ; commit;
transaction (i.e. you can send raw INSERTs or whatever as individual single-statement transactions). You can also see there that queries after a begin;
won’t work, and this reflects the underlying reality of the system (and how HTTP / the other API surface area works).
Our hope is that the pgwire compatibility will simplify using XTDB from various ecosystems, including Elixir, because you can lean on the existing Postgres-related tooling (even if the dialects aren’t 100% compatible - CockroachDB is similar although attempts much harder to be truly Postgres-dialect compatible).
Hopefully those explanations help 
Out of interest, which Elixir libs are you hoping to use?