Class: DashApi::SchemaController

Inherits:
ApplicationController show all
Defined in:
app/controllers/dash_api/schema_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



4
5
6
7
# File 'app/controllers/dash_api/schema_controller.rb', line 4

def index 
  tables = DashApi::Schema.table_names 
  render json: { data: tables }
end

#schemaObject



9
10
11
12
# File 'app/controllers/dash_api/schema_controller.rb', line 9

def schema       
  schema = DashApi::Schema.db_schema
  render json: { data: schema }
end

#showObject



14
15
16
17
# File 'app/controllers/dash_api/schema_controller.rb', line 14

def show         
  table_schema = DashApi::Schema.table_schema(params[:table_name])
  render json: { data: table_schema }
end