eav
Описание
Entity-Attribute-Value pattern implementation for Elixir Ecto with PostgreSQL support
Языки
- Elixir100%
год назад
год назад
год назад
год назад
год назад
год назад
год назад
год назад
год назад
год назад
README.md
EctoEAV
Entity-Attribute-Value pattern implementation for Elixir/Ecto with PostgreSQL support
Features
- Dynamic attributes with type validation
- One attribute value for one type, stored one times
- PostgreSQL-specific optimizations
- Migration generators
- Complex query support
- JSONB and array types handling
- Sugar functions for operate with entities and attributes
- View and Materialized View integration
[!WARNING] An entity can have only one attribute with a specific name and type. An attempt to add the same attribute with a different type will cause an exception.
Installation
Add to :mix.exs
Setup
- Generate migrations:
- Define entity schema:
Supported Types
| PG and in schema/migration type | Ecto type |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
more coming soon ...
Usage
Add attributes
Queryng
Pretty view
Advanced Querying
Operator-based Search
Use predefined operators for complex queries:
Supported Operators
| OPERATOR | PG OPERATOR | Description |
|---|---|---|
| | Equal |
| | Not equal |
| | Greater than , |
| | Less than , |
| | Greater than or equal , |
| | Less than or equal , |
| | Contains , |
| | Contained by , |
| | Overlap |
| | Case-sensitive pattern match |
| | Case-insensitive pattern |
| | List containment |