Class: Dbviewer::Api::TablesController

Inherits:
BaseController show all
Defined in:
app/controllers/dbviewer/api/tables_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#render_error, #render_success

Methods included from ErrorHandling

#handle_database_error, #log_error

Methods included from DatabaseOperations

#current_table?, #database_manager, #execute_query, #export_table_to_csv, #fetch_database_analytics, #fetch_filtered_record_count, #fetch_mini_erd_for_table, #fetch_table_columns, #fetch_table_metadata, #fetch_table_record_count, #fetch_table_records, #fetch_table_relationships, #fetch_tables, #get_adapter_name, #get_database_name, #prepare_query, #safe_quote_table_name, #table_query_operations

Instance Method Details

#indexObject



4
5
6
7
# File 'app/controllers/dbviewer/api/tables_controller.rb', line 4

def index
  tables_count = fetch_tables_count
  render_success(total_tables: tables_count)
end

#recordsObject



9
10
11
12
# File 'app/controllers/dbviewer/api/tables_controller.rb', line 9

def records
  tables_stats = fetch_tables_stats
  render_success(tables_stats)
end

#relationships_countObject



14
15
16
17
# File 'app/controllers/dbviewer/api/tables_controller.rb', line 14

def relationships_count
  total_relationships = calculate_total_relationships
  render_success(total_relationships: total_relationships)
end