Class: PGQueryStarter
Direct Known Subclasses
Constant Summary
Constants inherited from PGLogLine
Instance Attribute Summary collapse
-
#ignore ⇒ Object
readonly
Returns the value of attribute ignore.
Attributes inherited from PGLogLine
#cmd_no, #connection_id, #duration, #line_no, #text
Instance Method Summary collapse
- #append_to(queries) ⇒ Object
- #filter_query(text) ⇒ Object
-
#initialize(text, duration = nil) ⇒ PGQueryStarter
constructor
A new instance of PGQueryStarter.
Methods inherited from PGLogLine
Constructor Details
#initialize(text, duration = nil) ⇒ PGQueryStarter
Returns a new instance of PGQueryStarter.
218 219 220 |
# File 'lib/pqa.rb', line 218 def initialize(text, duration = nil) super(filter_query(text), duration) end |
Instance Attribute Details
#ignore ⇒ Object (readonly)
Returns the value of attribute ignore.
216 217 218 |
# File 'lib/pqa.rb', line 216 def ignore @ignore end |
Instance Method Details
#append_to(queries) ⇒ Object
227 228 229 230 |
# File 'lib/pqa.rb', line 227 def append_to(queries) queries.push(Query.new(@text, @ignore)) return nil end |
#filter_query(text) ⇒ Object
222 223 224 225 |
# File 'lib/pqa.rb', line 222 def filter_query(text) @ignore = (text =~ /begin/i) || (text =~ /VACUUM/i) || (text =~ /^select 1$/i) return text end |