Class: MatViews::Services::DeleteView
- Inherits:
-
BaseService
- Object
- BaseService
- MatViews::Services::DeleteView
- Defined in:
- lib/mat_views/services/delete_view.rb
Overview
Service that safely drops a PostgreSQL materialised view.
Options:
-
‘cascade:` (Boolean, default: false) → drop with CASCADE instead of RESTRICT
-
‘row_count_strategy:` (Symbol, default: :none) → one of `:estimated`, `:exact`, or `:none or nil` to control row count reporting
Returns a MatViews::ServiceResponse
Constant Summary
Constants inherited from BaseService
BaseService::ALLOWED_ROW_STRATEGIES, BaseService::DEFAULT_NIL_STRATEGY, BaseService::DEFAULT_ROW_STRATEGY, BaseService::UNKNOWN_ROW_COUNT
Instance Attribute Summary collapse
-
#cascade ⇒ Boolean
readonly
Whether to cascade the drop (default: false).
Attributes inherited from BaseService
#definition, #request, #response, #row_count_strategy, #use_transaction
Instance Method Summary collapse
-
#initialize(definition, cascade: false, row_count_strategy: :estimated) ⇒ DeleteView
constructor
A new instance of DeleteView.
Methods inherited from BaseService
Constructor Details
#initialize(definition, cascade: false, row_count_strategy: :estimated) ⇒ DeleteView
Returns a new instance of DeleteView.
43 44 45 46 |
# File 'lib/mat_views/services/delete_view.rb', line 43 def initialize(definition, cascade: false, row_count_strategy: :estimated) super(definition, row_count_strategy: row_count_strategy) @cascade = cascade ? true : false end |
Instance Attribute Details
#cascade ⇒ Boolean (readonly)
Whether to cascade the drop (default: false).
37 38 39 |
# File 'lib/mat_views/services/delete_view.rb', line 37 def cascade @cascade end |