Class: Superset::Sqllab::Execute
- Defined in:
- lib/superset/sqllab/execute.rb
Defined Under Namespace
Classes: InvalidParameterError
Constant Summary
Constants inherited from Request
Instance Attribute Summary collapse
-
#database_id ⇒ Object
readonly
Returns the value of attribute database_id.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
-
#query_limit ⇒ Object
readonly
Returns the value of attribute query_limit.
-
#schema ⇒ Object
readonly
Returns the value of attribute schema.
Attributes inherited from Request
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(database_id:, query:, schema: 'public', query_limit: 1000) ⇒ Execute
constructor
A new instance of Execute.
- #perform ⇒ Object
- #response ⇒ Object
Methods inherited from Request
Methods included from Display
#display_headers, #headings, #list, #list_attributes, #result, #rows, #table, #title
Constructor Details
#initialize(database_id:, query:, schema: 'public', query_limit: 1000) ⇒ Execute
Returns a new instance of Execute.
8 9 10 11 12 13 |
# File 'lib/superset/sqllab/execute.rb', line 8 def initialize(database_id: , query: , schema: 'public', query_limit: 1000) @database_id = database_id @query = query @schema = schema @query_limit = query_limit end |
Instance Attribute Details
#database_id ⇒ Object (readonly)
Returns the value of attribute database_id.
6 7 8 |
# File 'lib/superset/sqllab/execute.rb', line 6 def database_id @database_id end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
6 7 8 |
# File 'lib/superset/sqllab/execute.rb', line 6 def query @query end |
#query_limit ⇒ Object (readonly)
Returns the value of attribute query_limit.
6 7 8 |
# File 'lib/superset/sqllab/execute.rb', line 6 def query_limit @query_limit end |
#schema ⇒ Object (readonly)
Returns the value of attribute schema.
6 7 8 |
# File 'lib/superset/sqllab/execute.rb', line 6 def schema @schema end |
Instance Method Details
#data ⇒ Object
25 26 27 |
# File 'lib/superset/sqllab/execute.rb', line 25 def data response["data"] end |
#perform ⇒ Object
15 16 17 18 19 |
# File 'lib/superset/sqllab/execute.rb', line 15 def perform validate_constructor_args response data end |
#response ⇒ Object
21 22 23 |
# File 'lib/superset/sqllab/execute.rb', line 21 def response @response ||= client.post(route, query_params) end |