View Source Introspex.Postgres.RelationshipAnalyzer (Introspex v0.2.0)
Analyzes foreign key relationships between tables to determine Ecto associations (belongs_to, has_many, has_one, many_to_many).
Summary
Functions
Analyzes belongs_to relationships based on foreign keys in the current table.
Analyzes has_many relationships by looking for foreign keys in other tables that reference this table.
Analyzes has_one relationships (similar to has_many but with singular naming).
Analyzes many_to_many relationships by detecting join tables.
Analyzes all relationships for a given table and returns association definitions.
Determines if a table is likely a join table for many-to-many relationships.
Functions
Analyzes belongs_to relationships based on foreign keys in the current table.
Analyzes has_many relationships by looking for foreign keys in other tables that reference this table.
Analyzes has_one relationships (similar to has_many but with singular naming).
Analyzes many_to_many relationships by detecting join tables.
analyze_relationships(repo, table_name, all_tables, schema \\ "public")
View SourceAnalyzes all relationships for a given table and returns association definitions.
Determines if a table is likely a join table for many-to-many relationships.