Class: Dbviewer::Storage::Base
- Inherits:
-
Object
- Object
- Dbviewer::Storage::Base
- Defined in:
- lib/dbviewer/storage/base.rb
Overview
BaseStorage is an abstract base class that defines the interface for query storage backends
Direct Known Subclasses
Instance Method Summary collapse
-
#add(query) ⇒ Object
Add a new query to the storage.
-
#all ⇒ Object
Get all stored queries.
-
#clear ⇒ Object
Clear all stored queries.
-
#filter(limit:, table_filter:, request_id:, min_duration:) ⇒ Object
Filter the queries based on provided criteria.
-
#initialize ⇒ Base
constructor
Initialize the storage backend.
Constructor Details
#initialize ⇒ Base
Initialize the storage backend
6 7 8 |
# File 'lib/dbviewer/storage/base.rb', line 6 def initialize raise NotImplementedError, "#{self.class} is an abstract class and cannot be instantiated directly" end |
Instance Method Details
#add(query) ⇒ Object
Add a new query to the storage
16 17 18 |
# File 'lib/dbviewer/storage/base.rb', line 16 def add(query) raise NotImplementedError, "#{self.class}#add must be implemented by a subclass" end |
#all ⇒ Object
Get all stored queries
11 12 13 |
# File 'lib/dbviewer/storage/base.rb', line 11 def all raise NotImplementedError, "#{self.class}#all must be implemented by a subclass" end |
#clear ⇒ Object
Clear all stored queries
21 22 23 |
# File 'lib/dbviewer/storage/base.rb', line 21 def clear raise NotImplementedError, "#{self.class}#clear must be implemented by a subclass" end |
#filter(limit:, table_filter:, request_id:, min_duration:) ⇒ Object
Filter the queries based on provided criteria
26 27 28 |
# File 'lib/dbviewer/storage/base.rb', line 26 def filter(limit:, table_filter:, request_id:, min_duration:) raise NotImplementedError, "#{self.class}#filter must be implemented by a subclass" end |