dbviewer 0.7.10 → 0.7.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/app/assets/images/dbviewer/emoji-favicon.txt +1 -0
- data/app/assets/images/dbviewer/favicon.ico +4 -0
- data/app/assets/images/dbviewer/favicon.png +4 -0
- data/app/assets/images/dbviewer/favicon.svg +10 -0
- data/app/assets/javascripts/dbviewer/entity_relationship_diagram.js +38 -42
- data/app/assets/javascripts/dbviewer/error_handler.js +58 -0
- data/app/assets/javascripts/dbviewer/home.js +25 -34
- data/app/assets/javascripts/dbviewer/layout.js +100 -129
- data/app/assets/javascripts/dbviewer/query.js +309 -246
- data/app/assets/javascripts/dbviewer/sidebar.js +170 -183
- data/app/assets/javascripts/dbviewer/utility.js +124 -0
- data/app/assets/stylesheets/dbviewer/application.css +8 -146
- data/app/assets/stylesheets/dbviewer/entity_relationship_diagram.css +0 -34
- data/app/assets/stylesheets/dbviewer/logs.css +0 -11
- data/app/assets/stylesheets/dbviewer/query.css +21 -9
- data/app/assets/stylesheets/dbviewer/table.css +49 -131
- data/app/controllers/concerns/dbviewer/database_operations/connection_management.rb +90 -0
- data/app/controllers/concerns/dbviewer/database_operations/data_export.rb +31 -0
- data/app/controllers/concerns/dbviewer/database_operations/database_information.rb +54 -0
- data/app/controllers/concerns/dbviewer/database_operations/datatable_operations.rb +37 -0
- data/app/controllers/concerns/dbviewer/database_operations/query_operations.rb +37 -0
- data/app/controllers/concerns/dbviewer/database_operations/relationship_management.rb +175 -0
- data/app/controllers/concerns/dbviewer/database_operations/table_operations.rb +46 -0
- data/app/controllers/concerns/dbviewer/database_operations.rb +4 -9
- data/app/controllers/dbviewer/api/tables_controller.rb +12 -0
- data/app/controllers/dbviewer/entity_relationship_diagrams_controller.rb +0 -15
- data/app/controllers/dbviewer/tables_controller.rb +4 -33
- data/app/views/dbviewer/entity_relationship_diagrams/index.html.erb +1 -1
- data/app/views/dbviewer/tables/query.html.erb +21 -6
- data/app/views/dbviewer/tables/show.html.erb +2 -2
- data/app/views/layouts/dbviewer/application.html.erb +12 -3
- data/config/routes.rb +2 -2
- data/lib/dbviewer/database/manager.rb +2 -2
- data/lib/dbviewer/datatable/query_operations.rb +1 -17
- data/lib/dbviewer/engine.rb +29 -0
- data/lib/dbviewer/version.rb +1 -1
- metadata +15 -10
- data/app/controllers/concerns/dbviewer/connection_management.rb +0 -88
- data/app/controllers/concerns/dbviewer/data_export.rb +0 -32
- data/app/controllers/concerns/dbviewer/database_information.rb +0 -62
- data/app/controllers/concerns/dbviewer/datatable_support.rb +0 -47
- data/app/controllers/concerns/dbviewer/pagination_concern.rb +0 -34
- data/app/controllers/concerns/dbviewer/query_operations.rb +0 -28
- data/app/controllers/concerns/dbviewer/relationship_management.rb +0 -173
- data/app/controllers/concerns/dbviewer/table_operations.rb +0 -56
@@ -1,56 +0,0 @@
|
|
1
|
-
module Dbviewer
|
2
|
-
module TableOperations
|
3
|
-
extend ActiveSupport::Concern
|
4
|
-
|
5
|
-
# Fetch all tables with their stats
|
6
|
-
# By default, don't include record counts for better performance on sidebar
|
7
|
-
def fetch_tables(include_record_counts = false)
|
8
|
-
database_manager.tables.map do |table_name|
|
9
|
-
table_stats = {
|
10
|
-
name: table_name
|
11
|
-
}
|
12
|
-
table_stats[:record_count] = database_manager.record_count(table_name) if include_record_counts
|
13
|
-
table_stats
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
# Get column information for a specific table
|
18
|
-
def fetch_table_columns(table_name)
|
19
|
-
database_manager.table_columns(table_name)
|
20
|
-
end
|
21
|
-
|
22
|
-
# Get the total number of records in a table
|
23
|
-
def fetch_table_record_count(table_name)
|
24
|
-
database_manager.table_count(table_name)
|
25
|
-
end
|
26
|
-
|
27
|
-
# Fetch records for a table with pagination and sorting
|
28
|
-
def fetch_table_records(table_name, query_params)
|
29
|
-
database_manager.table_records(table_name, query_params)
|
30
|
-
end
|
31
|
-
|
32
|
-
# Get filtered record count for a table
|
33
|
-
def fetch_filtered_record_count(table_name, column_filters)
|
34
|
-
database_manager.filtered_record_count(table_name, column_filters)
|
35
|
-
end
|
36
|
-
|
37
|
-
# Safely quote a table name, with fallback
|
38
|
-
def safe_quote_table_name(table_name)
|
39
|
-
database_manager.connection.quote_table_name(table_name) rescue table_name.to_s
|
40
|
-
end
|
41
|
-
|
42
|
-
# Get table metadata for display (e.g., primary key, foreign keys, indexes)
|
43
|
-
def fetch_table_metadata(table_name)
|
44
|
-
database_manager.table_metadata(table_name)
|
45
|
-
end
|
46
|
-
|
47
|
-
private
|
48
|
-
|
49
|
-
# Check if a table has a created_at column for timestamp visualization
|
50
|
-
def has_timestamp_column?(table_name)
|
51
|
-
fetch_table_columns(table_name).any? do |column|
|
52
|
-
column[:name] == "created_at" && [ :datetime, :timestamp ].include?(column[:type])
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|