class

Spacetime::Wasm::Datastore

Inherits Reference < Object

Transactional datastore supporting both in-memory execution (for native Crystal specs & local simulation) and WASM host syscall delegation when compiled for wasm32.

Instance methods

delete_by_pk(type : T.class, pk) : UInt32 forall T
Source
find_by_pk(type : T.class, pk) : T | Nil forall T
Source
in_transaction=(in_transaction : Bool)
Source
in_transaction?
Source
insert(row : T) : T forall T
Source
insert_bsatn(table_id : TableId, row_bytes : Bytes) : Bytes
Source
register_table(name : String) : TableId
Source
register_table(type : T.class) : TableId forall T
Source
row_count(table_id : TableId) : UInt64
Source
row_count(type : T.class) : UInt64 forall T
Source
scan(type : T.class) : Array(T) forall T
Source
scan_bsatn(table_id : TableId) : Array(Bytes)
Source
table_id_from_name(name : String) : TableId
Source
transaction

Executes a block inside an atomic transaction, rolling back state if an exception is raised.

Source
update_by_pk(row : T) : Bool forall T
Source