Skip to content

Commit

Permalink
Update readme examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jonatanklosko committed Dec 3, 2024
1 parent 97bcf22 commit 15ac15d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ The struct implements the `Table.Reader` protocol and thus can be efficiently tr

```elixir
Mix.install([
{:req, "~> 0.3.5"},
{:req_athena, "~> 0.1.3"}
{:req, "~> 0.5.8"},
{:req_athena, "~> 0.3.0"}
])

opts = [
Expand All @@ -24,7 +24,7 @@ opts = [
output_location: "s3://my-bucket"
]

req = Req.new() |> ReqAthena.attach(opts)
req = ReqAthena.new(opts)

# Create table from Registry of Open Data on AWS
# See: https://registry.opendata.aws/osm/
Expand All @@ -48,7 +48,7 @@ STORED AS ORCFILE
LOCATION 's3://osm-pds/planet/';
"""

Req.post!(req, athena: query).body
ReqAthena.query!(req, query).body
# =>
# %{
# "Output" => "",
Expand All @@ -63,7 +63,7 @@ Req.post!(req, athena: query).body
# With plain string query
query = "SELECT id, type, tags, members, timestamp, visible FROM planet WHERE id = 470454 and type = 'relation'"

Req.post!(req, athena: query, format: :json).body
ReqAthena.query!(req, query, [], format: :json).body
# =>
# [
# %{
Expand All @@ -90,7 +90,7 @@ Req.post!(req, athena: query, format: :json).body
# With parameterized query
query = "SELECT id, type FROM planet WHERE id = ? and type = ?"

Req.post!(req, athena: {query, [239_970_142, "node"]}).body
ReqAthena.query!(req, query, [239_970_142, "node"], format: :json).body
#=> [%{"id" => 239970142, "type" => "node"}]
```

Expand Down

0 comments on commit 15ac15d

Please sign in to comment.