Class: Fx::Adapters::Sqlserver::Triggers Private
- Inherits:
-
Object
- Object
- Fx::Adapters::Sqlserver::Triggers
- Defined in:
- lib/fx/adapters/sqlserver/triggers.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Fetches defined triggers from the sqlserver connection.
Constant Summary collapse
- TRIGGERS_WITH_DEFINITIONS_QUERY =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
The query must return two attributes, name and definition
<<-STR SELECT t.name AS name, m.definition AS definition FROM sys.triggers t, sys.sql_modules m WHERE t.type = 'TR' AND t.object_id = m.object_id STR
Class Method Summary collapse
-
.all(*args) ⇒ Array<Fx::Trigger>
private
Wraps #all as a static facade.
Instance Method Summary collapse
-
#all ⇒ Array<Fx::Trigger>
private
All of the triggers that this connection has defined.
-
#initialize(connection) ⇒ Triggers
constructor
private
A new instance of Triggers.
Constructor Details
#initialize(connection) ⇒ Triggers
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Triggers.
30 31 32 |
# File 'lib/fx/adapters/sqlserver/triggers.rb', line 30 def initialize(connection) @connection = connection end |
Class Method Details
.all(*args) ⇒ Array<Fx::Trigger>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Wraps #all as a static facade.
26 27 28 |
# File 'lib/fx/adapters/sqlserver/triggers.rb', line 26 def self.all(*args) new(*args).all end |
Instance Method Details
#all ⇒ Array<Fx::Trigger>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
All of the triggers that this connection has defined.
37 38 39 |
# File 'lib/fx/adapters/sqlserver/triggers.rb', line 37 def all triggers_from_sqlserver.map { |trigger| to_fx_trigger(trigger) } end |