Skip to content

Commit

Permalink
Added presto-client
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Jul 23, 2018
1 parent 9c6227c commit cc0774a
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ gem "net-telnet"
gem "octokit"
gem "patron"
gem "pg"
gem "presto-client"
gem "rake"
gem "redis"
gem "rest-client"
Expand Down
5 changes: 5 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ GEM
mongoid (7.0.1)
activemodel (>= 5.1, < 6.0.0)
mongo (>= 2.5.1, < 3.0.0)
msgpack (1.2.4)
multi_json (1.13.1)
multi_xml (0.6.0)
multipart-post (2.0.0)
Expand Down Expand Up @@ -259,6 +260,9 @@ GEM
os (0.9.6)
patron (0.13.1)
pg (1.0.0)
presto-client (0.5.11)
faraday (~> 0.12)
msgpack (>= 0.7.0)
public_suffix (3.0.2)
rack (2.0.5)
rack-test (1.1.0)
Expand Down Expand Up @@ -389,6 +393,7 @@ DEPENDENCIES
octokit
patron
pg
presto-client
rake
redis
rest-client
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Data Stores
- [mongoid](#mongoid)
- [mysql2](#mysql2)
- [pg](#pg)
- [presto-client](#presto-client)
- [redis](#redis)
- [rsolr](#rsolr)
- [ruby-druid](#ruby-druid)
Expand Down Expand Up @@ -360,6 +361,17 @@ PG.connect(connect_timeout: 1, ...)

Raises `PG::ConnectionBad`

### presto-client

```ruby
Presto::Client.new(http_open_timeout: 1, http_timeout: 1)
```

Raises

- `Faraday::ConnectionFailed` on connect timeout
- `Faraday::TimeoutError` on read timeout

### redis

```ruby
Expand Down
17 changes: 17 additions & 0 deletions test/presto_client_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
require_relative "test_helper"

class PrestoClientTest < Minitest::Test
def test_connect
client = Presto::Client.new(server: connect_host, http_open_timeout: 1)
assert_timeout(Faraday::ConnectionFailed) do
client.run("select * from sys.node")
end
end

def test_read
client = Presto::Client.new(server: read_host_and_port, http_timeout: 1)
assert_timeout(Faraday::TimeoutError) do
client.run("select * from sys.node")
end
end
end

0 comments on commit cc0774a

Please sign in to comment.