summaryrefslogtreecommitdiff
path: root/examples/get_distribution_image.rb
blob: b318b6cbe80412ca7b3a357103dd46a75ffd744f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env 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