hierarch v0.2.0 Hierarch.LTree View Source
Link to this section Summary
Functions
Concat path or string
Join list into a string path
Return the parent_id of the given ltree path
Return parent path of the given path
Return the root_id of the given ltree path
Split string path into an arry
Link to this section Functions
Link to this function
concat(one, another) View Source
Concat path or string
Link to this function
join(list) View Source
Join list into a string path
Link to this function
parent_id(path) View Source
Return the parent_id of the given ltree path
Examples
iex> LTree.parent_id("Top")
"Top"
iex> LTree.parent_id("")
nil
iex> LTree.parent_id("")
nil
iex> LTree.parent_id(nil)
nil
Link to this function
parent_path(path) View Source
Return parent path of the given path
Link to this function
root_id(path, current_pk) View Source
Return the root_id of the given ltree path
Examples
iex> LTree.root_id("Top", "Science")
"Top"
iex> LTree.root_id("", "Top")
"Top"
iex> LTree.root_id(nil, "Top")
"Top"
Options:
current_pk
- the primary key of the current schema
Link to this function
split(path) View Source
Split string path into an arry