Class: Dbviewer::Configuration
- Inherits:
-
Object
- Object
- Dbviewer::Configuration
- Defined in:
- lib/dbviewer/configuration.rb
Overview
Configuration class for DBViewer engine settings
Instance Attribute Summary collapse
-
#admin_credentials ⇒ Object
Admin access credentials hash with :username and :password keys.
-
#cache_expiry ⇒ Object
Cache expiration time in seconds.
-
#default_order_column ⇒ Object
Default column to order table details by (e.g., ‘updated_at’).
-
#default_per_page ⇒ Object
Default number of records per page.
-
#enable_data_export ⇒ Object
Allow downloading of data in various formats.
-
#enable_query_logging ⇒ Object
Enable or disable query logging completely.
-
#max_memory_queries ⇒ Object
Maximum number of queries to keep in memory.
-
#max_query_length ⇒ Object
Maximum SQL query length allowed.
-
#max_records ⇒ Object
Maximum number of records to return in any query.
-
#per_page_options ⇒ Object
Default pagination options.
-
#query_log_path ⇒ Object
Path for query log file when in :file mode.
-
#query_logging_mode ⇒ Object
Query logging storage mode (:memory or :file).
-
#query_timeout ⇒ Object
Timeout for SQL queries in seconds.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/dbviewer/configuration.rb', line 44 def initialize @per_page_options = [ 10, 20, 50, 100 ] @default_per_page = 20 @max_records = 10000 @max_query_length = 10000 @cache_expiry = 300 @enable_data_export = false @query_timeout = 30 @query_logging_mode = :memory @query_log_path = "log/dbviewer.log" @max_memory_queries = 1000 @enable_query_logging = true @admin_credentials = nil @default_order_column = "updated_at" end |
Instance Attribute Details
#admin_credentials ⇒ Object
Admin access credentials hash with :username and :password keys
39 40 41 |
# File 'lib/dbviewer/configuration.rb', line 39 def admin_credentials @admin_credentials end |
#cache_expiry ⇒ Object
Cache expiration time in seconds
17 18 19 |
# File 'lib/dbviewer/configuration.rb', line 17 def cache_expiry @cache_expiry end |
#default_order_column ⇒ Object
Default column to order table details by (e.g., ‘updated_at’)
42 43 44 |
# File 'lib/dbviewer/configuration.rb', line 42 def default_order_column @default_order_column end |
#default_per_page ⇒ Object
Default number of records per page
8 9 10 |
# File 'lib/dbviewer/configuration.rb', line 8 def default_per_page @default_per_page end |
#enable_data_export ⇒ Object
Allow downloading of data in various formats
20 21 22 |
# File 'lib/dbviewer/configuration.rb', line 20 def enable_data_export @enable_data_export end |
#enable_query_logging ⇒ Object
Enable or disable query logging completely
35 36 37 |
# File 'lib/dbviewer/configuration.rb', line 35 def enable_query_logging @enable_query_logging end |
#max_memory_queries ⇒ Object
Maximum number of queries to keep in memory
32 33 34 |
# File 'lib/dbviewer/configuration.rb', line 32 def max_memory_queries @max_memory_queries end |
#max_query_length ⇒ Object
Maximum SQL query length allowed
14 15 16 |
# File 'lib/dbviewer/configuration.rb', line 14 def max_query_length @max_query_length end |
#max_records ⇒ Object
Maximum number of records to return in any query
11 12 13 |
# File 'lib/dbviewer/configuration.rb', line 11 def max_records @max_records end |
#per_page_options ⇒ Object
Default pagination options
5 6 7 |
# File 'lib/dbviewer/configuration.rb', line 5 def @per_page_options end |
#query_log_path ⇒ Object
Path for query log file when in :file mode
29 30 31 |
# File 'lib/dbviewer/configuration.rb', line 29 def query_log_path @query_log_path end |
#query_logging_mode ⇒ Object
Query logging storage mode (:memory or :file)
26 27 28 |
# File 'lib/dbviewer/configuration.rb', line 26 def query_logging_mode @query_logging_mode end |
#query_timeout ⇒ Object
Timeout for SQL queries in seconds
23 24 25 |
# File 'lib/dbviewer/configuration.rb', line 23 def query_timeout @query_timeout end |