abstract class Sepia::StorageBackend

Overview

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

Direct Known Subclasses

Defined in:

sepia/storage_backend.cr

Instance Method Summary

Instance Method Detail

abstract def clear #

Clear all data (useful for testing)


[View source]
abstract def count(object_class : Class) : Int32 #

Count objects of a given class


[View source]
abstract def delete(class_name : String, id : String) #

Delete an object by its class name and ID


[View source]
abstract def delete(object : Serializable | Container) #

Delete an object


[View source]
abstract def exists?(object_class : Class, id : String) : Bool #

Check if an object exists


[View source]
abstract def export_data : Hash(String, Array(Hash(String, String))) #

Export all data as a hash structure


[View source]
abstract def import_data(data : Hash(String, Array(Hash(String, String)))) #

Import data from a hash structure


[View source]
abstract def list_all(object_class : Class) : Array(String) #

List all object IDs of a given class


[View source]
abstract def list_all_objects : Hash(String, Array(String)) #

List all objects, grouped by class name


[View source]
abstract def load(object_class : Class, id : String, path : String | Nil = nil) : Object #

Load an object by class and ID


[View source]
abstract def save(object : Serializable, path : String | Nil = nil) #

Save a Serializable object


[View source]
abstract def save(object : Container, path : String | Nil = nil) #

Save a Container object


[View source]