<commit_before># TXID

{% method -%}

Pushes current transaction's identifier onto the top of the stack 

Input stack: -

Output stack: `transaction id`

In certain cases it is worthwhile to learn whether some data was recorded
within the boundaries of the same transaction as other. This instruction allows
to do this by retrieving ongoing transaction's ID

Transaction identifiers are guaranteed to be unique and grow monotonically,
thus allowing one to compare the order of their origination.

{% common -%}

```
PumpkinDB> [ TXID ] READ.
0x0000000014cbed8aff34dc5000000000
```

{% endmethod %}

## Allocation

None

## Errors

[NoTransaction](./errors/NoTransaction.md) error if there's no ongoing transaction.

## Tests

```test
read : [TXID] READ SOME?.
write : [TXID] WRITE SOME?.
same_within_tx : [TXID TXID] WRITE EQUAL?.
ordering : [TXID] WRITE [TXID] WRITE LT?.
requires_txn : [TXID] TRY UNWRAP 0x08 EQUAL?.
```<commit_msg>Problem: `TXID` manual doesn't specify identifier's length<commit_after># TXID

{% method -%}

Pushes current transaction's identifier onto the top of the stack 

Input stack: -

Output stack: `transaction id`

In certain cases it is worthwhile to learn whether some data was recorded
within the boundaries of the same transaction as other. This instruction allows
to do this by retrieving ongoing transaction's ID

Transaction identifiers are guaranteed to be unique and grow monotonically,
thus allowing one to compare the order of their origination.

Exact length is not guaranteed, however, for the purpose of comparability,
it is guaranteed that all transaction identifiers are of the same length.

{% common -%}

```
PumpkinDB> [ TXID ] READ.
0x0000000014cbed8aff34dc5000000000
```

{% endmethod %}

## Allocation

None

## Errors

[NoTransaction](./errors/NoTransaction.md) error if there's no ongoing transaction.

## Tests

```test
read : [TXID] READ SOME?.
write : [TXID] WRITE SOME?.
same_within_tx : [TXID TXID] WRITE EQUAL?.
ordering : [TXID] WRITE [TXID] WRITE LT?.
requires_txn : [TXID] TRY UNWRAP 0x08 EQUAL?.
```
{'fraction_non_alphanumeric': 0.08870576829859428, 'fraction_numerical': 0.02617547261269995, 'mean_word_length': 4.670329670329671, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5066581', 'n_tokens_mistral': 695, 'n_tokens_neox': 602, 'n_words': 259}