https://github.com/hashrocket/ecto_pg_extras
A collection of custom functions for PostgreSQL features in Ecto
https://github.com/hashrocket/ecto_pg_extras
Last synced: about 1 year ago
JSON representation
A collection of custom functions for PostgreSQL features in Ecto
- Host: GitHub
- URL: https://github.com/hashrocket/ecto_pg_extras
- Owner: hashrocket
- License: mit
- Created: 2017-03-27T22:25:23.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-02T17:33:21.000Z (about 9 years ago)
- Last Synced: 2025-03-27T14:21:15.935Z (about 1 year ago)
- Language: Elixir
- Homepage: https://hex.pm/packages/ecto_pg_extras
- Size: 19.5 KB
- Stars: 17
- Watchers: 9
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ecto_pg_extras
> A collection of custom functions for PostgreSQL features in Ecto
```elixir
def deps do
[{:ecto_pg_extras, "~> 0.1.0"}]
end
```
## Usage
Import `ecto_pg_extras` in any module where you want access to the custom
functions for use with Ecto queries.
```elixir
import EctoPgExtras
```
Then use any of the functions as part of a query as you would anything else
defined in `Ecto.Query.API`. For example, here is the `coalesce` function in
action:
```elixir
from(posts in Posts,
where: posts.id == 1,
select: {
posts.title,
coalesce(posts.description, posts.short_description, "N/A")
})
```
## About
[](https://hashrocket.com)
EctoPgExtras is supported by the team at [Hashrocket](https://hashrocket.com), a multidisciplinary design & development consultancy. If you'd like to [work with us](https://hashrocket.com/contact-us/hire-us) or [join our team](https://hashrocket.com/contact-us/jobs), don't hesitate to get in touch.