You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Repo is `superset-client` with the gem named `superset`
5
+
The Repo is `superset-client` with the ruby gem named `superset`
6
6
7
7
All ruby classes are namespaced under `Superset::`
8
8
9
-
## Installation
9
+
# Installation
10
+
11
+
## Docker Setup
12
+
13
+
Build, bundle and open a ruby console
10
14
11
-
Add to your Gemfile
12
15
```
13
-
gem 'superset'
16
+
docker-compose build
17
+
docker-compose run --rm app bundle install
18
+
docker-compose run --rm app bin/console
14
19
```
15
20
16
-
And then execute:
21
+
Run specs
22
+
23
+
```
24
+
docker-compose run --rm app rspec
25
+
# or
26
+
docker-compose run --rm app bash # then run 'bundle exec rspec' from the container.
27
+
```
17
28
18
-
$ bundle
29
+
## Local setup or including in a Ruby/Rails app
19
30
20
-
Or install it yourself as:
31
+
Add to your Gemfile `gem 'superset'`
32
+
And then execute: `bundle install`
33
+
Or install it yourself as `gem install superset`
21
34
22
-
$ gem install superset
35
+
## Setup API Credentials
23
36
37
+
Follow this doc setup your users API creds [setting_up_personal_api_credentials](https://github.com/rdytech/superset-client/tree/develop/doc/setting_up_personal_api_credentials.md)
38
+
39
+
Short version is .. copy the `env.sample` to `.env` and add edit values where applicable. Opening a console with `bin/console` will then auto load the `.env` file.
24
40
25
41
## Usage
26
42
27
-
Experiment with the API calls directly by open a pry console using
28
-
`bin/console`
43
+
Experiment with the API calls directly by open a pry console using `bin/console`
29
44
30
-
Primary usage is for general api calls and/or for guest token retrieval when setting up applications to use the superset embedded dashboard workflow.
31
45
32
-
The Superset API users may then fall into 2 categories
33
-
- a user for general api calls to endpoints for Dashboards, Datasets, Charts, Users, Roles etc. ref `Superset::Credential::ApiUser`
34
-
which pulls credentials from
35
-
`ENV['SUPERSET_API_USERNAME']` and `ENV['SUPERSET_API_PASSWORD']`
36
46
37
-
- a user for guest token api call to use when embedding dashboards in a host application. ref `Superset::Credential::EmbeddedUser`
38
-
which pulls credentials from
39
-
`ENV['SUPERSET_EMBEDDED_USERNAME']` and `ENV['SUPERSET_EMBEDDED_PASSWORD']`
40
47
41
-
Configure your superset host in
42
-
`ENV['SUPERSET_HOST']`
48
+
### API calls
49
+
50
+
Quickstart examples
51
+
52
+
```ruby
53
+
Superset::Database::List.call
54
+
Superset::Database::GetSchemas.new(1).list # get schemas for database 1
Copy the `env.sample` to `.env` and add edit values where applicable.
45
-
Opening a console with `bin/console` will then auto load the `.env` file.
59
+
Superset::Dashboard::BulkDelete.new(dashboard_ids: [1,2,3]).perform # Dashboards only ( leaves all charts, datasets in place)
60
+
Superset::Dashboard::BulkDeleteCascade.new(dashboard_ids: [1,2,3]).perform # Dashboards and related charts and datasets.
46
61
47
-
See here to setup your users API creds [setting_up_personal_api_credentials](https://github.com/rdytech/superset-client/tree/develop/doc/setting_up_personal_api_credentials.md)
62
+
Superset::Sqllab::Execute.new(database_id:1, schema:'public', query:'select count(*) from birth_names').perform
0 commit comments