Module: RailsConsolePro::Commands
- Extended by:
- Commands
- Included in:
- Commands
- Defined in:
- lib/rails_console_pro/commands.rb,
lib/rails_console_pro/commands/base_command.rb,
lib/rails_console_pro/commands/diff_command.rb,
lib/rails_console_pro/commands/jobs_command.rb,
lib/rails_console_pro/commands/stats_command.rb,
lib/rails_console_pro/commands/export_command.rb,
lib/rails_console_pro/commands/schema_command.rb,
lib/rails_console_pro/commands/compare_command.rb,
lib/rails_console_pro/commands/explain_command.rb,
lib/rails_console_pro/commands/profile_command.rb,
lib/rails_console_pro/commands/snippets_command.rb,
lib/rails_console_pro/commands/introspect_command.rb,
lib/rails_console_pro/commands/query_builder_command.rb
Overview
Command methods for schema inspection and SQL explain Thin facade that delegates to command classes
Defined Under Namespace
Classes: BaseCommand, Comparator, CompareCommand, DiffCommand, ExplainCommand, ExportCommand, IntrospectCommand, JobsCommand, ProfileCommand, QueryBuilderCommand, SchemaCommand, SnippetsCommand, StatsCommand
Instance Method Summary collapse
-
#compare(&block) ⇒ Object
Query comparison command.
-
#diff(object1, object2) ⇒ Object
Object comparison command.
-
#explain(relation_or_model, *args) ⇒ Object
SQL explain command.
-
#export(data, file_path, format: nil) ⇒ Object
Export data to file (works with any exportable object).
-
#introspect(model_class, *options) ⇒ Object
Model introspection command.
-
#jobs(options = {}) ⇒ Object
Queue insights command.
-
#profile(target = nil, *args, **kwargs, &block) ⇒ Object
Profiling command.
-
#query(model_class, &block) ⇒ Object
Query builder command.
-
#schema(model_class) ⇒ Object
Schema inspection command.
-
#snippets(action = :list, *args, **kwargs, &block) ⇒ Object
Snippets command.
-
#stats(model_class) ⇒ Object
Model statistics command.
Instance Method Details
#compare(&block) ⇒ Object
Query comparison command
55 56 57 |
# File 'lib/rails_console_pro/commands.rb', line 55 def compare(&block) CompareCommand.new.execute(&block) end |
#diff(object1, object2) ⇒ Object
Object comparison command
30 31 32 |
# File 'lib/rails_console_pro/commands.rb', line 30 def diff(object1, object2) DiffCommand.new.execute(object1, object2) end |
#explain(relation_or_model, *args) ⇒ Object
SQL explain command
15 16 17 |
# File 'lib/rails_console_pro/commands.rb', line 15 def explain(relation_or_model, *args) ExplainCommand.new.execute(relation_or_model, *args) end |
#export(data, file_path, format: nil) ⇒ Object
Export data to file (works with any exportable object)
20 21 22 |
# File 'lib/rails_console_pro/commands.rb', line 20 def export(data, file_path, format: nil) ExportCommand.new.execute(data, file_path, format: format) end |
#introspect(model_class, *options) ⇒ Object
Model introspection command
50 51 52 |
# File 'lib/rails_console_pro/commands.rb', line 50 def introspect(model_class, *) IntrospectCommand.new.execute(model_class, *) end |
#jobs(options = {}) ⇒ Object
Queue insights command
40 41 42 |
# File 'lib/rails_console_pro/commands.rb', line 40 def jobs( = {}) JobsCommand.new.execute() end |
#profile(target = nil, *args, **kwargs, &block) ⇒ Object
Profiling command
35 36 37 |
# File 'lib/rails_console_pro/commands.rb', line 35 def profile(target = nil, *args, **kwargs, &block) ProfileCommand.new.execute(target, *args, **kwargs, &block) end |
#query(model_class, &block) ⇒ Object
Query builder command
60 61 62 |
# File 'lib/rails_console_pro/commands.rb', line 60 def query(model_class, &block) QueryBuilderCommand.new.execute(model_class, &block) end |
#schema(model_class) ⇒ Object
Schema inspection command
10 11 12 |
# File 'lib/rails_console_pro/commands.rb', line 10 def schema(model_class) SchemaCommand.new.execute(model_class) end |
#snippets(action = :list, *args, **kwargs, &block) ⇒ Object
Snippets command
45 46 47 |
# File 'lib/rails_console_pro/commands.rb', line 45 def snippets(action = :list, *args, **kwargs, &block) SnippetsCommand.new.execute(action, *args, **kwargs, &block) end |
#stats(model_class) ⇒ Object
Model statistics command
25 26 27 |
# File 'lib/rails_console_pro/commands.rb', line 25 def stats(model_class) StatsCommand.new.execute(model_class) end |