category

# `recorded_database_core`

Legacy recorded database predicates. Can be imported into an object to provide a local database.

Availability:
`logtalk_load(recorded_database(loader))`
Author: Paulo Moura
Version: 1:0:0
Date: 2023-12-17
Compilation flags:
`static`
Dependencies:
(none)
Remarks:

> - References: Opaque ground terms.

Inherited public predicates:
(none)

## Public predicates

### `recorda/3`

Adds a term as the first term for the given key, returning its reference.

Compilation flags:
`static`
Template:
`recorda(Key,Term,Reference)`
Mode and number of proofs:
`recorda(+recorded_database_key,+term,--recorded_database_reference)` - `one_or_error`
Exceptions:
`Key` is a variable:
`instantiation_error`
`Key` is neither a variable nor an atomic term or compound term:
`type_error(recorded_database_key,Key)`
`Reference` is a not a variable:
`uninstantiation_error(Reference)`

### `recorda/2`

Adds a term as the first term for the given key.

Compilation flags:
`static`
Template:
`recorda(Key,Term)`
Mode and number of proofs:
`recorda(+recorded_database_key,+term)` - `one_or_error`
Exceptions:
`Key` is a variable:
`instantiation_error`
`Key` is neither a variable nor an atomic term or compound term:
`type_error(recorded_database_key,Key)`

### `recordz/3`

Adds a term as the last term for the given key, returning its reference.

Compilation flags:
`static`
Template:
`recordz(Key,Term,Reference)`
Mode and number of proofs:
`recordz(+recorded_database_key,+term,--recorded_database_reference)` - `one_or_error`
Exceptions:
`Key` is a variable:
`instantiation_error`
`Key` is neither a variable nor an atomic term or compound term:
`type_error(recorded_database_key,Key)`
`Reference` is a not a variable:
`uninstantiation_error(Reference)`

### `recordz/2`

Adds a term as the last term for the given key.

Compilation flags:
`static`
Template:
`recordz(Key,Term)`
Mode and number of proofs:
`recordz(+recorded_database_key,+term)` - `one_or_error`
Exceptions:
`Key` is a variable:
`instantiation_error`
`Key` is neither a variable nor an atomic term or compound term:
`type_error(recorded_database_key,Key)`

### `recorded/3`

Enumerates, by backtracking, all record key-term pairs and their references.

Compilation flags:
`static`
Template:
`recorded(Key,Term,Reference)`
Mode and number of proofs:
`recorded(?recorded_database_key,?term,-recorded_database_reference)` - `zero_or_more`
`recorded(?recorded_database_key,?term,+recorded_database_reference)` - `zero_or_one`

### `recorded/2`

Enumerates, by backtracking, all record key-term pairs.

Compilation flags:
`static`
Template:
`recorded(Key,Term)`
Mode and number of proofs:
`recorded(?recorded_database_key,?term)` - `zero_or_more`

### `erase/1`

Erases the record indexed by the given reference. Fails if there is no record with the given reference.

Compilation flags:
`static`
Template:
`erase(Reference)`
Mode and number of proofs:
`erase(@recorded_database_reference)` - `zero_or_one_or_error`
Exceptions:
`Reference` is a variable:
`instantiation_error`

### `instance/2`

.

Compilation flags:
`static`
Template:
`instance(Reference,Term)`
Mode and number of proofs:
`instance(@recorded_database_reference,?term)` - `zero_or_one_or_error`
Exceptions:
`Reference` is a variable:
`instantiation_error`

## Protected predicates

(none)

## Private predicates

### `record_/3`

Records table.

Compilation flags:
`dynamic`
Template:
`record_(Key,Term,Reference)`
Mode and number of proofs:
`record_(?recorded_database_key,?term,?recorded_database_reference)` - `zero_or_more`

### `reference_/1`

Reference count.

Compilation flags:
`dynamic`
Template:
`reference_(Reference)`
Mode and number of proofs:
`reference_(?non_negative_integer)` - `zero_or_one`

## Operators

(none)