Skip to content

instadeq/elixir-delta-sharing-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DeltaSharing

Elixir client library for the Delta Sharing Protocol by the instadeq team

Status

Implements the whole protocol as of this version

Library Structure

There are two main modules:

  • DeltaSharing.RawClient: does the requests and returns the raw HTTP responses
  • DeltaSharing.Client: does the requests and parses the responses returning Elixir structs

Sample Usage

Download open-datasets.share or any other profile file you have access to

alias DeltaSharing.{Profile, Client, RawClient}
p = Profile.from_file("../open-datasets.share")
c = Client.new(p)

RawClient.list_shares(c)
RawClient.get_share(c, "delta_sharing")
RawClient.list_schemas_in_share(c, "delta_sharing")
RawClient.list_tables_in_schemas(c, "delta_sharing", "default")
RawClient.list_all_tables_in_share(c, "delta_sharing")
RawClient.query_table_version(c, "delta_sharing", "default", "COVID_19_NYT")
RawClient.query_table_metadata(c, "delta_sharing", "default", "COVID_19_NYT")
RawClient.query_table(c, "delta_sharing", "default", "COVID_19_NYT", 10)

Client.list_shares(c)
Client.get_share(c, "delta_sharing")
Client.list_schemas_in_share(c, "delta_sharing")
Client.list_tables_in_schemas(c, "delta_sharing", "default")

# pagination
{:ok, r1} = Client.list_tables_in_schemas(c, "delta_sharing", "default", 5)
Client.next(c, r1, 5)

Client.list_all_tables_in_share(c, "delta_sharing")

# pagination
{:ok, r2} = Client.list_all_tables_in_share(c, "delta_sharing", 5)
Client.next(c, r2, 5)

Client.query_table_version(c, "delta_sharing", "default", "COVID_19_NYT")
Client.query_table_metadata(c, "delta_sharing", "default", "COVID_19_NYT")
Client.query_table(c, "delta_sharing", "default", "COVID_19_NYT", 10)

Installation

Follow Instructions on hex.pm/packages/delta_sharing/

Docs

delta_sharing docs on Hex Docs

License

MIT

About

Elixir Client for the Delta Sharing Protocol

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published