bin/dblink in dblink-0.3 vs bin/dblink in dblink-0.4
- old
+ new
@@ -25,10 +25,11 @@
verbose: false,
host: 'localhost',
port: 5432,
user: ENV['USER'],
database: ENV['USER'],
+ public: false,
check_local: true,
check_tonnel: true
}
OptionParser.new do |opts|
@@ -56,10 +57,14 @@
opts.on("-P", "--password [PASSWORD]", "PostgreSQL password") do |value|
CLI_OPTS[:password] = value
end
+ opts.on("--public", "Default false. Add it to public catalog") do |value|
+ CLI_OPTS[:public] = value
+ end
+
opts.on("-cl", "--[no-]check-local", "Default true. Check connection to local PostgreSQL server") do |value|
CLI_OPTS[:check_local] = value
end
opts.on("-cr", "--[no-]check-remote", "Default true. Check connection via ssh tonnel") do |value|
@@ -172,11 +177,11 @@
end
db_url = pgb_runner.make_db_url(tonnel.remote_port)
puts
-puts "DATABSE CONNECTION:"
+puts "DATABSE URL:"
puts " #{db_url}"
puts
psql_path = PsqlRunner.find_psql
if psql_path
@@ -184,10 +189,10 @@
passwd = pgb_runner.pgb_password == '' ? '' : "PGPASSWORD=#{pgb_runner.pgb_password}"
puts " #{passwd} #{psql_path} -h dblink.tk -p #{tonnel.remote_port} -U #{pgb_runner.pgb_user} #{pgb_runner.pg_db}"
puts
end
-web_response = WebService.register_link(db_url, verbose: CLI_OPTS[:verbose])
+web_response = WebService.register_link(db_url, is_public: CLI_OPTS[:public], verbose: CLI_OPTS[:verbose])
if web_response['status'] == 'success'
puts "WEB URL:"
puts " #{web_response['web_url']}"
puts