shimoju / metabase-ruby

Ruby client library for Metabase API
MIT License
28 stars 27 forks source link

Supports `/api/dataset/:export-format` endpoint #66

Closed mrtc0 closed 3 years ago

mrtc0 commented 3 years ago

This PR is support dataset endpoint /api/dataset/#{format} .

query = '{"type":"native","native":{"query":"SELECT * FROM orders LIMIT 1;"},"database":1}'
client.query_dataset(query: query)
# =>[{"CREATED_AT"=>"2019-02-11T21:40:27.892", "PRODUCT_ID"=>14,"USER_ID"=>1,...}]

This endpoint requires a Content-Type header for application/x-www-form-urlencoded, so I made it possible to set custom headers.

shimoju commented 3 years ago

Thanks!!!