Sha256: ae8d7fa95799a78f029adccb55ed9322a7ddfd8a7408117e23bd177637205f65

Contents?: true

Size: 961 Bytes

Versions: 79

Compression:

Stored size: 961 Bytes

Contents

require("cipherstash-pg")
$stdout.sync = true
TIMEOUT = 5.0
CONN_OPTS = { :host => "localhost", :dbname => "test" }
def output_progress(msg)
  puts(">>> #{msg}\n")
end
output_progress("Starting connection...")
(conn = CipherStashPG.connect(CONN_OPTS) or abort("Unable to create a new connection!"))
unless (conn.status == CipherStashPG::CONNECTION_OK) then
  abort(("Connect failed: %s" % [conn.error_message]))
end
socket = conn.socket_io
output_progress("Sending query")
conn.send_query("SELECT * FROM pg_stat_activity")
loop do
  output_progress("  waiting for a response")
  conn.consume_input
  while conn.is_busy do
    output_progress(("  waiting for data to be available on %p..." % [socket]))
    (select([socket], nil, nil, TIMEOUT) or raise("Timeout waiting for query response."))
    conn.consume_input
  end
  (result = conn.get_result or break)
  output_progress(("Query result:\n%p\n" % [result.values]))
end
output_progress("Done.")
conn.finish

Version data entries

79 entries across 79 versions & 1 rubygems

Version Path
cipherstash-pg-1.0.0.beta.22-x86_64-linux ./sample/async_mixed.rb
cipherstash-pg-1.0.0.beta.22-x86_64-darwin ./sample/async_mixed.rb
cipherstash-pg-1.0.0.beta.22-arm64-darwin ./sample/async_mixed.rb
cipherstash-pg-1.0.0.beta.22-aarch64-linux ./sample/async_mixed.rb
cipherstash-pg-1.0.0.beta.21-x86_64-linux ./sample/async_mixed.rb
cipherstash-pg-1.0.0.beta.21-aarch64-linux ./sample/async_mixed.rb
cipherstash-pg-1.0.0.beta.21-arm64-darwin ./sample/async_mixed.rb
cipherstash-pg-1.0.0.beta.21-x86_64-darwin ./sample/async_mixed.rb
cipherstash-pg-1.0.0.beta.19-x86_64-linux ./sample/async_mixed.rb
cipherstash-pg-1.0.0.beta.19-x86_64-darwin ./sample/async_mixed.rb
cipherstash-pg-1.0.0.beta.19-arm64-darwin ./sample/async_mixed.rb
cipherstash-pg-1.0.0.beta.19-aarch64-linux ./sample/async_mixed.rb
cipherstash-pg-1.0.0.beta.18-x86_64-linux ./sample/async_mixed.rb
cipherstash-pg-1.0.0.beta.18-x86_64-darwin ./sample/async_mixed.rb
cipherstash-pg-1.0.0.beta.18-arm64-darwin ./sample/async_mixed.rb
cipherstash-pg-1.0.0.beta.18-aarch64-linux ./sample/async_mixed.rb
cipherstash-pg-1.0.0.beta.17-aarch64-linux ./sample/async_mixed.rb
cipherstash-pg-1.0.0.beta.17-x86_64-darwin ./sample/async_mixed.rb
cipherstash-pg-1.0.0.beta.17-x86_64-linux ./sample/async_mixed.rb
cipherstash-pg-1.0.0.beta.17-arm64-darwin ./sample/async_mixed.rb