Class: Vdb::SchemaToGraph
- Inherits:
-
Object
- Object
- Vdb::SchemaToGraph
- Defined in:
- app/services/vdb/schema_to_graph.rb
Constant Summary collapse
- EXCLUDED_TABLES =
%w[ active_storage_attachments active_storage_blobs active_storage_variant_records action_text_rich_texts ar_internal_metadata schema_migrations solid_cache_entries solid_queue_jobs solid_queue_scheduled_executions solid_queue_claimed_executions solid_queue_failed_executions solid_queue_pauses solid_queue_processes solid_queue_ready_executions solid_queue_recurring_executions solid_queue_recurring_tasks solid_queue_semaphores solid_cable_messages ].freeze
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(schema_rb) ⇒ SchemaToGraph
constructor
A new instance of SchemaToGraph.
Constructor Details
#initialize(schema_rb) ⇒ SchemaToGraph
Returns a new instance of SchemaToGraph.
20 21 22 23 24 |
# File 'app/services/vdb/schema_to_graph.rb', line 20 def initialize(schema_rb) @schema_rb = schema_rb.to_s @tables = {} # name => { fields: [[col, type]], unique_cols: Set, explicit_fks: [] } @fk_links = [] # { from:, to: } end |
Class Method Details
.call(schema_rb) ⇒ Object
16 17 18 |
# File 'app/services/vdb/schema_to_graph.rb', line 16 def self.call(schema_rb) new(schema_rb).call end |
Instance Method Details
#call ⇒ Object
26 27 28 29 30 |
# File 'app/services/vdb/schema_to_graph.rb', line 26 def call parse! infer_foreign_keys! { nodes: build_nodes, links: build_links } end |