Module: Dbviewer
- Defined in:
- lib/dbviewer.rb,
lib/dbviewer/engine.rb,
lib/dbviewer/version.rb,
lib/dbviewer/query/logger.rb,
lib/dbviewer/query/parser.rb,
lib/dbviewer/storage/base.rb,
lib/dbviewer/configuration.rb,
lib/dbviewer/sql_validator.rb,
lib/dbviewer/query/analyzer.rb,
lib/dbviewer/query/executor.rb,
lib/dbviewer/database/manager.rb,
lib/dbviewer/query/collection.rb,
app/jobs/dbviewer/application_job.rb,
lib/dbviewer/storage/file_storage.rb,
lib/dbviewer/database/cache_manager.rb,
lib/dbviewer/datatable/query_params.rb,
app/models/dbviewer/application_record.rb,
lib/dbviewer/database/metadata_manager.rb,
lib/dbviewer/storage/in_memory_storage.rb,
app/helpers/dbviewer/application_helper.rb,
app/mailers/dbviewer/application_mailer.rb,
lib/dbviewer/datatable/query_operations.rb,
app/controllers/dbviewer/home_controller.rb,
app/controllers/dbviewer/logs_controller.rb,
lib/generators/dbviewer/install_generator.rb,
app/controllers/dbviewer/tables_controller.rb,
lib/dbviewer/database/dynamic_model_factory.rb,
app/controllers/dbviewer/api/base_controller.rb,
app/controllers/dbviewer/api/tables_controller.rb,
app/controllers/dbviewer/api/queries_controller.rb,
app/controllers/dbviewer/application_controller.rb,
app/controllers/concerns/dbviewer/error_handling.rb,
app/controllers/dbviewer/api/database_controller.rb,
app/controllers/concerns/dbviewer/pagination_concern.rb,
app/controllers/concerns/dbviewer/database_operations.rb,
app/controllers/dbviewer/entity_relationship_diagrams_controller.rb,
app/controllers/dbviewer/api/entity_relationship_diagrams_controller.rb
Defined Under Namespace
Modules: Api, ApplicationHelper, Database, DatabaseOperations, Datatable, ErrorHandling, Generators, PaginationConcern, Query, Storage Classes: ApplicationController, ApplicationJob, ApplicationMailer, ApplicationRecord, Configuration, Engine, EntityRelationshipDiagramsController, HomeController, LogsController, SqlValidator, TablesController
Constant Summary collapse
- VERSION =
"0.5.6"
Class Attribute Summary collapse
-
.configuration ⇒ Object
Get configuration settings.
Class Method Summary collapse
-
.configure {|configuration| ... } ⇒ Object
Configure the engine with a block.
-
.init ⇒ Object
Initialize engine with default values or user-provided configuration.
-
.reset_configuration ⇒ Object
Reset configuration to defaults.
-
.setup ⇒ Object
This class method will be called by the engine when it’s appropriate.
Class Attribute Details
.configuration ⇒ Object
Get configuration settings
32 33 34 |
# File 'lib/dbviewer.rb', line 32 def configuration @configuration ||= Configuration.new end |
Class Method Details
.configure {|configuration| ... } ⇒ Object
Configure the engine with a block
43 44 45 |
# File 'lib/dbviewer.rb', line 43 def configure yield(configuration) if block_given? end |
.init ⇒ Object
Initialize engine with default values or user-provided configuration
67 68 69 70 71 72 73 74 75 76 |
# File 'lib/dbviewer.rb', line 67 def init # Define class methods to access configuration Dbviewer::SqlValidator.singleton_class.class_eval do define_method(:configuration) { Dbviewer.configuration } define_method(:max_query_length) { Dbviewer.configuration.max_query_length } end # Log initialization Rails.logger.info("[DBViewer] Initialized with configuration: #{configuration.inspect}") end |
.reset_configuration ⇒ Object
Reset configuration to defaults
48 49 50 |
# File 'lib/dbviewer.rb', line 48 def reset_configuration @configuration = Configuration.new end |
.setup ⇒ Object
This class method will be called by the engine when it’s appropriate
53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/dbviewer.rb', line 53 def setup # Configure the query logger with current configuration settings Dbviewer::Query::Logger.configure( enable_query_logging: configuration.enable_query_logging, query_logging_mode: configuration.query_logging_mode ) ActiveRecord::Base.connection Rails.logger.info "DBViewer successfully connected to database" rescue => e Rails.logger.error "DBViewer could not connect to database: #{e.}" end |