# -*- ruby -*- require 'yugabyte_ysql' require 'stringio' $stderr.puts "Opening database connection ..." conn = YugabyteYSQL.connect(:dbname => 'test' ) conn.exec( < err errmsg = "%s while reading copy data: %s" % [ err.class.name, err.message ] conn.put_copy_end( errmsg ) else conn.put_copy_end while res = conn.get_result $stderr.puts "Result of COPY is: %s" % [ res.res_status(res.result_status) ] end end end conn.finish