diff options
Diffstat (limited to 'lib/oxidized/source/sql.rb')
-rw-r--r-- | lib/oxidized/source/sql.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/oxidized/source/sql.rb b/lib/oxidized/source/sql.rb index 5737c93..c5fe650 100644 --- a/lib/oxidized/source/sql.rb +++ b/lib/oxidized/source/sql.rb @@ -18,11 +18,16 @@ module Oxidized end end - def load + def load node_want = nil nodes = [] db = connect query = db[@cfg.table.to_sym] query = query.with_sql(@cfg.query) if @cfg.query? + + if node_want + query = query.where(@cfg.map.name.to_sym => node_want) + end + query.each do |node| # map node parameters keys = {} |