summaryrefslogtreecommitdiff
path: root/examples/get_distribution_image.rb
blob: b840a1a587730a0d3c80cc2966f222260221ee68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/ruby
#
#  get_distribution_image DB KEY nodes|ways
#

require 'rubygems'
require 'sqlite3'

filename = ARGV[0]
key      = ARGV[1]
type     = ARGV[2]

db = SQLite3::Database.new(filename)

db.execute("SELECT #{type} FROM key_distributions WHERE key=?", key) do |row|
    $stdout.write row[0]
end