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.
-
#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
78 79 80 |
# File 'lib/sequent/core/persistors/persistor.rb', line 78 def commit fail "Method not supported in this persistor" end |
#create_or_update_record ⇒ Object
Creates or updates a record in the view state.
26 27 28 |
# File 'lib/sequent/core/persistors/persistor.rb', line 26 def create_or_update_record fail "Method not supported in this persistor" end |
#create_record ⇒ Object
Create a single record in the view state
16 17 18 |
# File 'lib/sequent/core/persistors/persistor.rb', line 16 def create_record fail "Method not supported in this persistor" end |
#create_records ⇒ Object
Creates multiple records at once in the view state
21 22 23 |
# File 'lib/sequent/core/persistors/persistor.rb', line 21 def create_records fail "Method not supported in this persistor" end |
#delete_all_records ⇒ Object
Deletes all records given a where
40 41 42 |
# File 'lib/sequent/core/persistors/persistor.rb', line 40 def delete_all_records fail "Method not supported in this persistor" end |
#delete_record ⇒ Object
Delete a single record
63 64 65 |
# File 'lib/sequent/core/persistors/persistor.rb', line 63 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
57 58 59 |
# File 'lib/sequent/core/persistors/persistor.rb', line 57 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
51 52 53 |
# File 'lib/sequent/core/persistors/persistor.rb', line 51 def do_with_records fail "Method not supported in this persistor" end |
#find_records ⇒ Object
Find records given a where
68 69 70 |
# File 'lib/sequent/core/persistors/persistor.rb', line 68 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
35 36 37 |
# File 'lib/sequent/core/persistors/persistor.rb', line 35 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
30 31 32 |
# File 'lib/sequent/core/persistors/persistor.rb', line 30 def get_record! fail "Method not supported in this persistor" end |
#last_record ⇒ Object
Returns the last record given a where
73 74 75 |
# File 'lib/sequent/core/persistors/persistor.rb', line 73 def last_record fail "Method not supported in this persistor" end |
#update_all_records ⇒ Object
Updates all record given a where and an update clause
45 46 47 |
# File 'lib/sequent/core/persistors/persistor.rb', line 45 def update_all_records fail "Method not supported in this persistor" end |
#update_record ⇒ Object
Updates the view state
11 12 13 |
# File 'lib/sequent/core/persistors/persistor.rb', line 11 def update_record fail "Method not supported in this persistor" end |