dbviewer 0.4.7 → 0.5.0
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 +4 -20
- data/app/controllers/concerns/dbviewer/database_operations.rb +1 -30
- data/app/controllers/dbviewer/api/base_controller.rb +19 -0
- data/app/controllers/dbviewer/api/database_controller.rb +14 -0
- data/app/controllers/dbviewer/api/queries_controller.rb +18 -0
- data/app/controllers/dbviewer/api/tables_controller.rb +39 -0
- data/app/controllers/dbviewer/home_controller.rb +0 -92
- data/app/controllers/dbviewer/tables_controller.rb +20 -4
- data/app/views/dbviewer/home/index.html.erb +182 -28
- data/app/views/dbviewer/tables/show.html.erb +135 -2
- data/app/views/layouts/dbviewer/application.html.erb +184 -84
- data/app/views/layouts/dbviewer/shared/_sidebar.html.erb +0 -1
- data/config/routes.rb +18 -7
- data/lib/dbviewer/configuration.rb +4 -0
- data/lib/dbviewer/version.rb +1 -1
- data/lib/generators/dbviewer/structured_api_generator.rb +11 -0
- data/lib/generators/dbviewer/templates/initializer.rb +3 -0
- metadata +7 -2
data/config/routes.rb
CHANGED
@@ -19,13 +19,24 @@ Dbviewer::Engine.routes.draw do
|
|
19
19
|
# Homepage and API endpoints
|
20
20
|
get "dashboard", to: "home#index", as: :dashboard
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
22
|
+
namespace :api do
|
23
|
+
resources :tables, only: [ :index ] do
|
24
|
+
collection do
|
25
|
+
get "records"
|
26
|
+
get "relationships_count"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
resource :database, only: [], controller: "database" do
|
31
|
+
get "size"
|
32
|
+
end
|
33
|
+
|
34
|
+
resources :queries, only: [] do
|
35
|
+
collection do
|
36
|
+
get "recent"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
29
40
|
|
30
41
|
root to: "home#index"
|
31
42
|
end
|
@@ -38,6 +38,9 @@ module Dbviewer
|
|
38
38
|
# @example { username: 'admin', password: 'secret' }
|
39
39
|
attr_accessor :admin_credentials
|
40
40
|
|
41
|
+
# Default column to order table details by (e.g., 'updated_at')
|
42
|
+
attr_accessor :default_order_column
|
43
|
+
|
41
44
|
def initialize
|
42
45
|
@per_page_options = [ 10, 20, 50, 100 ]
|
43
46
|
@default_per_page = 20
|
@@ -51,6 +54,7 @@ module Dbviewer
|
|
51
54
|
@max_memory_queries = 1000
|
52
55
|
@enable_query_logging = true
|
53
56
|
@admin_credentials = nil
|
57
|
+
@default_order_column = "updated_at"
|
54
58
|
end
|
55
59
|
end
|
56
60
|
end
|
data/lib/dbviewer/version.rb
CHANGED
@@ -0,0 +1,11 @@
|
|
1
|
+
module Dbviewer
|
2
|
+
module Generators
|
3
|
+
class StructuredApiGenerator < Rails::Generators::Base
|
4
|
+
source_root File.expand_path("../templates", __FILE__)
|
5
|
+
|
6
|
+
def create_initializer
|
7
|
+
template "structured_api_initializer.rb", "config/initializers/dbviewer_structured_api.rb"
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -15,4 +15,7 @@ Dbviewer.configure do |config|
|
|
15
15
|
|
16
16
|
# Authentication options
|
17
17
|
# config.admin_credentials = { username: "admin", password: "your_secure_password" } # Basic HTTP auth credentials
|
18
|
+
|
19
|
+
# Default table ordering options
|
20
|
+
config.default_order_column = "updated_at" # Primary column to order by
|
18
21
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dbviewer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wailan Tirajoh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-05-
|
11
|
+
date: 2025-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -55,6 +55,10 @@ files:
|
|
55
55
|
- app/controllers/concerns/dbviewer/database_operations.rb
|
56
56
|
- app/controllers/concerns/dbviewer/error_handling.rb
|
57
57
|
- app/controllers/concerns/dbviewer/pagination_concern.rb
|
58
|
+
- app/controllers/dbviewer/api/base_controller.rb
|
59
|
+
- app/controllers/dbviewer/api/database_controller.rb
|
60
|
+
- app/controllers/dbviewer/api/queries_controller.rb
|
61
|
+
- app/controllers/dbviewer/api/tables_controller.rb
|
58
62
|
- app/controllers/dbviewer/application_controller.rb
|
59
63
|
- app/controllers/dbviewer/entity_relationship_diagrams_controller.rb
|
60
64
|
- app/controllers/dbviewer/home_controller.rb
|
@@ -96,6 +100,7 @@ files:
|
|
96
100
|
- lib/dbviewer/table_query_params.rb
|
97
101
|
- lib/dbviewer/version.rb
|
98
102
|
- lib/generators/dbviewer/initializer_generator.rb
|
103
|
+
- lib/generators/dbviewer/structured_api_generator.rb
|
99
104
|
- lib/generators/dbviewer/templates/initializer.rb
|
100
105
|
- lib/tasks/dbviewer_tasks.rake
|
101
106
|
homepage: https://github.com/wailantirajoh/dbviewer
|