Features ======== Until all features are implemented, this section will gather existing features. Entremets statements -------------------- Transaction ^^^^^^^^^^^ You can open a transaction with the following syntax: :code:`transaction do...`. * **tx_name:** it can be used as a variable in the spec to check the transaction status * **tx_level:** for now only :code`read_committed` is supported Expressions ^^^^^^^^^^^ An expression can be one of: * An sql expression (see the dedicated section) * A binary operation (+, -, /, *, %, =, <>, <=, <, in, and, or, >, >=) * An assignment :code:` := ` * A variable name * A literal integer or string * A set :code:`{...}` * A tuple :code:`(...)` * A member call, for now only on transactions :code:`.aborted` or :code:`.committed` Latch ^^^^^ Latches allow processes to wait for each other. When a process encounters a latch, it wait all other processes to either be waiting for the latch or to have finished. If/Else ^^^^^^^ Execute the block only if the provided expression is ``true``. If the expression is ``false``, the optional else block provided in the else is executed instead. .. code-block:: entremets if `update users set age := $t2_age * 2 where id = 1 and age = $t2_age` = 0 do abort else end Temporal expressions ^^^^^^^^^^^^^^^^^^^^ in properties you can check for the following temporal operators: * **always:** Checks if the expression provided is ``true`` for every state * **never:** opposite of always. Checks if the expression provided is ``false`` for every state * **eventually:** Checks the statement is ``true`` for every possible state path Sql Expressions --------------- * **Select:** :code:`select from where order_by limit offset for update` * **Update:** :code:`update
set := where ` * **Delete:** :code:`delete from
where ` * **Insert:** :code:`insert into
() values ` * **Unique constraint:** :code:`create unique index on
()` * **Foreign keys:** :code:`alter table
add constraint foreign key() references ()` * Binary operations (+, -, *, /, %, =, and, in, <>, <, <=, >, >=, :code:`between and `)