dbviewer 0.7.2 → 0.7.3
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 +7 -33
- data/app/controllers/dbviewer/home_controller.rb +0 -6
- data/lib/dbviewer/database/dynamic_model_factory.rb +16 -0
- data/lib/dbviewer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50301b7fa1867ac7e266e3b48eb962e7e456de1e43a664750e8885a9b603f6ca
|
4
|
+
data.tar.gz: 0377f20859609a2807bdecc8bc5f9118dae6581b7d4819504900e7e6a371dba3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b17042fe0172fba83874c2498a99e9b9681092c5aedefb495cd2d55a41913d2d84dbbbdac3daa03a59928d465d7538183aa3dc5f12e41fda54add729b8963291
|
7
|
+
data.tar.gz: e3163cce763297208aeccae790ee6fb9890a2f084a974e2ac3e41acc0dac51ea6d005409cc57c71e3e605d1d406e7ea95b1ae9b83647800ae6d26d1444b8083e
|
data/README.md
CHANGED
@@ -37,7 +37,7 @@ You can explore a live demo of DBViewer at [https://dbviewer-demo.wailantirajoh.
|
|
37
37
|
Add this line to your application's Gemfile:
|
38
38
|
|
39
39
|
```ruby
|
40
|
-
gem "dbviewer"
|
40
|
+
gem "dbviewer"
|
41
41
|
```
|
42
42
|
|
43
43
|
And then execute:
|
@@ -151,9 +151,11 @@ end
|
|
151
151
|
|
152
152
|
Each connection needs to reference an ActiveRecord class that establishes a database connection. For more details, see [Multiple Database Connections](docs/multiple_connections.md).
|
153
153
|
|
154
|
-
## 🪵 Query Logging
|
154
|
+
## 🪵 Query Logging (Development Only)
|
155
155
|
|
156
|
-
DBViewer includes a powerful SQL query logging system that captures and analyzes database queries. You can access this log through the `/dbviewer/logs` endpoint.
|
156
|
+
DBViewer includes a powerful SQL query logging system that captures and analyzes database queries. You can access this log through the `/dbviewer/logs` endpoint.
|
157
|
+
|
158
|
+
The logging system offers two storage backends:
|
157
159
|
|
158
160
|
### Disabling Query Logging
|
159
161
|
|
@@ -210,34 +212,6 @@ end
|
|
210
212
|
When credentials are provided, all DBViewer routes will be protected by HTTP Basic Authentication.
|
211
213
|
Without valid credentials, users will be prompted for a username and password before they can access any DBViewer page.
|
212
214
|
|
213
|
-
## 🌱 Production Access
|
214
|
-
|
215
|
-
With the addition of Basic Authentication, DBViewer can now be used in any environment including production. We recommend the following for production deployments:
|
216
|
-
|
217
|
-
1. **Always** enable HTTP Basic Authentication with strong credentials:
|
218
|
-
|
219
|
-
```ruby
|
220
|
-
Dbviewer.configure do |config|
|
221
|
-
config.admin_credentials = {
|
222
|
-
username: "unique_username",
|
223
|
-
password: SecureRandom.hex(16) # Generate a strong random password
|
224
|
-
}
|
225
|
-
end
|
226
|
-
```
|
227
|
-
|
228
|
-
2. Mount the engine in your routes file:
|
229
|
-
|
230
|
-
```ruby
|
231
|
-
# In any environment, with Basic Auth protection
|
232
|
-
mount Dbviewer::Engine, at: "/dbviewer"
|
233
|
-
```
|
234
|
-
|
235
|
-
3. Access the tool through your regular application URL:
|
236
|
-
|
237
|
-
```
|
238
|
-
https://yourdomain.com/dbviewer
|
239
|
-
```
|
240
|
-
|
241
215
|
## 📝 Security Note
|
242
216
|
|
243
217
|
⚠️ **Warning**: This engine provides direct access to your database contents, which contains sensitive information. Always protect it with HTTP Basic Authentication by configuring strong credentials as shown above.
|
@@ -260,10 +234,10 @@ The simplest way to update is using Bundler:
|
|
260
234
|
|
261
235
|
```ruby
|
262
236
|
# For the latest version
|
263
|
-
gem "dbviewer"
|
237
|
+
gem "dbviewer"
|
264
238
|
|
265
239
|
# Or specify a version
|
266
|
-
gem "dbviewer", "~> 0.
|
240
|
+
gem "dbviewer", "~> 0.7.2"
|
267
241
|
```
|
268
242
|
|
269
243
|
- Run bundle update:
|
@@ -83,6 +83,22 @@ module Dbviewer
|
|
83
83
|
|
84
84
|
# Disable timestamps for better compatibility
|
85
85
|
self.record_timestamps = false
|
86
|
+
|
87
|
+
# Make the model read-only to prevent accidental data modifications
|
88
|
+
def readonly?
|
89
|
+
true
|
90
|
+
end
|
91
|
+
|
92
|
+
# Disable write operations at the class level
|
93
|
+
class << self
|
94
|
+
def delete_all(*)
|
95
|
+
raise ActiveRecord::ReadOnlyRecord, "#{name} is a read-only model"
|
96
|
+
end
|
97
|
+
|
98
|
+
def update_all(*)
|
99
|
+
raise ActiveRecord::ReadOnlyRecord, "#{name} is a read-only model"
|
100
|
+
end
|
101
|
+
end
|
86
102
|
end)
|
87
103
|
end
|
88
104
|
end
|
data/lib/dbviewer/version.rb
CHANGED
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.7.
|
4
|
+
version: 0.7.3
|
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-06-
|
11
|
+
date: 2025-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|