Helpers for working with :ident fields on columns.

(ns metabase.lib.metadata.ident)

Returns the ident for an implicitly joined column, given the idents of the foreign key column and the target column.

Remember that :ident strings should never be parsed - they are opaque, but should be legible during debugging.

(defn implicitly-joined-ident
  [target-ident fk-ident]
  (str "implicit_via__" fk-ident "__->__" target-ident))

Returns the ident for an explicitly joined column, given the idents of the join clause and the target column.

Remember that :ident strings should never be parsed - they are opaque, but should be legible during debugging.

(defn explicitly-joined-ident
  [target-ident join-ident]
  (str "join__" join-ident "__" target-ident))