Sha256: eafae09a54805613b95ecd008a33d84685d5ccb40b2cc9b6bbd49c40f15682a9

Contents?: true

Size: 687 Bytes

Versions: 1

Compression:

Stored size: 687 Bytes

Contents

# SequelPgLtree

## notice
Sequel ORM postgresql ltree helper inspired by https://github.com/sjke/pg_ltree

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'sequel_pg_ltree'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install sequel_pg_ltree

## Usage

```sql
 id | path
----+-------
  1 | A
  2 | A.B
  3 | A.C
  4 | A.C.D
  5 | A.C.E
  6 | A.C.F
  7 | A.B.G
```

```ruby
class Tree < Sequel::Model(:tree)
  plugin :pg_ltree, :column => :path
end

Tree.find(id: 2).root.path # => A
Tree.find(id: 2).parent.path # => A
Tree.where(id: 1).first.children.each do |c|
  c[:path]
end # => A.B  A.C

```

## TODO
tests should be added

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sequel_pg_ltree-0.1.8 README.md