Module: Sequent::Core::Persistors::Persistor
- Included in:
- ActiveRecordPersistor, ReplayOptimizedPostgresPersistor
- Defined in:
- lib/sequent/core/persistors/persistor.rb
Overview
Defines the methods that can be implemented by the specific Persistors
See
-
ActiveRecordPersistor
-
ReplayOptimizedPostgresPersistor
Instance Method Summary collapse
-
#commit ⇒ Object
Hook to implement for instance the persistor batches statements.
-
#create_or_update_record ⇒ Object
Creates or updates a record in the view state.
-
#create_record ⇒ Object
Create a single record in the view state.
-
#create_records ⇒ Object
Creates multiple records at once in the view state.
-
#delete_all_records ⇒ Object
Deletes all records given a where.
- #delete_record ⇒ Object deprecated Deprecated.
- #do_with_record ⇒ Object deprecated Deprecated.
- #do_with_records ⇒ Object deprecated Deprecated.
-
#find_records ⇒ Object
Find records given a where.
-
#get_record ⇒ Object
Gets a record from the view state, returns
nil
if it not exists. -
#get_record! ⇒ Object
Gets a record from the view state, fails if it not exists.
-
#last_record ⇒ Object
Returns the last record given a where.
-
#prepare ⇒ Object
Hook to implement for instance the persistor batches statements.
-
#update_all_records ⇒ Object
Updates all record given a where and an update clause.
-
#update_record ⇒ Object
Updates the view state.
Instance Method Details
#commit ⇒ Object
Hook to implement for instance the persistor batches statements
85 86 87 |
# File 'lib/sequent/core/persistors/persistor.rb', line 85 def commit fail 'Method not supported in this persistor' end |
#create_or_update_record ⇒ Object
Creates or updates a record in the view state.
28 29 30 |
# File 'lib/sequent/core/persistors/persistor.rb', line 28 def create_or_update_record fail 'Method not supported in this persistor' end |
#create_record ⇒ Object
Create a single record in the view state
18 19 20 |
# File 'lib/sequent/core/persistors/persistor.rb', line 18 def create_record fail 'Method not supported in this persistor' end |
#create_records ⇒ Object
Creates multiple records at once in the view state
23 24 25 |
# File 'lib/sequent/core/persistors/persistor.rb', line 23 def create_records fail 'Method not supported in this persistor' end |
#delete_all_records ⇒ Object
Deletes all records given a where
42 43 44 |
# File 'lib/sequent/core/persistors/persistor.rb', line 42 def delete_all_records fail 'Method not supported in this persistor' end |
#delete_record ⇒ Object
Delete a single record
65 66 67 |
# File 'lib/sequent/core/persistors/persistor.rb', line 65 def delete_record fail 'Method not supported in this persistor' end |
#do_with_record ⇒ Object
Decide for yourself what to do with a single record
59 60 61 |
# File 'lib/sequent/core/persistors/persistor.rb', line 59 def do_with_record fail 'Method not supported in this persistor' end |
#do_with_records ⇒ Object
Decide for yourself what to do with the records
53 54 55 |
# File 'lib/sequent/core/persistors/persistor.rb', line 53 def do_with_records fail 'Method not supported in this persistor' end |
#find_records ⇒ Object
Find records given a where
70 71 72 |
# File 'lib/sequent/core/persistors/persistor.rb', line 70 def find_records fail 'Method not supported in this persistor' end |
#get_record ⇒ Object
Gets a record from the view state, returns nil
if it not exists
37 38 39 |
# File 'lib/sequent/core/persistors/persistor.rb', line 37 def get_record fail 'Method not supported in this persistor' end |
#get_record! ⇒ Object
Gets a record from the view state, fails if it not exists
32 33 34 |
# File 'lib/sequent/core/persistors/persistor.rb', line 32 def get_record! fail 'Method not supported in this persistor' end |
#last_record ⇒ Object
Returns the last record given a where
75 76 77 |
# File 'lib/sequent/core/persistors/persistor.rb', line 75 def last_record fail 'Method not supported in this persistor' end |
#prepare ⇒ Object
Hook to implement for instance the persistor batches statements
80 81 82 |
# File 'lib/sequent/core/persistors/persistor.rb', line 80 def prepare fail 'Method not supported in this persistor' end |
#update_all_records ⇒ Object
Updates all record given a where and an update clause
47 48 49 |
# File 'lib/sequent/core/persistors/persistor.rb', line 47 def update_all_records fail 'Method not supported in this persistor' end |
#update_record ⇒ Object
Updates the view state
13 14 15 |
# File 'lib/sequent/core/persistors/persistor.rb', line 13 def update_record fail 'Method not supported in this persistor' end |