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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f1d51130bb3ed8d46ab3602679788ee98812bce9dbab988e32999c3b50f445fe
4
- data.tar.gz: 53aa2f65c0dafce3d118de8801a69cd233b4c437eaccc9974b609dce12591148
3
+ metadata.gz: 50301b7fa1867ac7e266e3b48eb962e7e456de1e43a664750e8885a9b603f6ca
4
+ data.tar.gz: 0377f20859609a2807bdecc8bc5f9118dae6581b7d4819504900e7e6a371dba3
5
5
  SHA512:
6
- metadata.gz: c1566aef41e200d6b1e61cdb665381480eb592e3e738cf3f74c2c8be2cdc9cf8f616ed63b2e9883a286fd41b1f0e8708bf05875e0a6beaea796e22bc40d9afeb
7
- data.tar.gz: 1b84dfca22a4421f437e02f85d5c290d37f9a48dedd4e0f5f309c4e64a3d1f06d3de916a043cc448061f320fc31899d4c9346252e6ac907680ef7499c6e49c9f
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", group: :development
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. The logging system offers two storage backends:
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", group: :development
237
+ gem "dbviewer"
264
238
 
265
239
  # Or specify a version
266
- gem "dbviewer", "~> 0.3.2", group: :development
240
+ gem "dbviewer", "~> 0.7.2"
267
241
  ```
268
242
 
269
243
  - Run bundle update:
@@ -7,11 +7,5 @@ module Dbviewer
7
7
  key: current_connection_key
8
8
  }
9
9
  end
10
-
11
- private
12
-
13
- def set_tables
14
- @tables = fetch_tables(include_record_counts: true)
15
- end
16
10
  end
17
11
  end
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Dbviewer
2
- VERSION = "0.7.2"
2
+ VERSION = "0.7.3"
3
3
  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.7.2
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-10 00:00:00.000000000 Z
11
+ date: 2025-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails