class

Sepia::StorageBackend

Inherits Reference < Object

Abstract base class for storage backends. All storage implementations must inherit from this class.

Instance methods

clear

Clear all data (useful for testing)

Source
count(object_class : Class) : Int32

Count objects of a given class

Source
delete(class_name : String, id : String)

Delete an object by its class name and ID

Source
delete(object : Serializable | Container)

Delete an object

Source
exists?(object_class : Class, id : String) : Bool

Check if an object exists

Source
export_data

Export all data as a hash structure

Source
import_data(data : Hash(String, Array(Hash(String, String))))

Import data from a hash structure

Source
list_all(object_class : Class) : Array(String)

List all object IDs of a given class

Source
list_all_objects

List all objects, grouped by class name

Source
load(object_class : Class, id : String, path : String | Nil = nil) : Object

Load an object by class and ID

Source
save(object : Serializable, path : String | Nil = nil)

Save a Serializable object

Source
save(object : Container, path : String | Nil = nil)

Save a Container object

Source