https://github.com/overminddl1/ecto_interval
Interval type for Ecto, currently only implemented for PostgreSQL, other database PR's are welcome.
https://github.com/overminddl1/ecto_interval
Last synced: 7 days ago
JSON representation
Interval type for Ecto, currently only implemented for PostgreSQL, other database PR's are welcome.
- Host: GitHub
- URL: https://github.com/overminddl1/ecto_interval
- Owner: OvermindDL1
- Created: 2017-07-05T15:39:02.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-09-09T15:33:20.000Z (10 months ago)
- Last Synced: 2025-04-14T02:34:03.969Z (3 months ago)
- Language: Elixir
- Size: 36.1 KB
- Stars: 25
- Watchers: 1
- Forks: 20
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# EctoInterval
Interval type for Ecto, currently only implemented for PostgreSQL, PR's to support others are welcome.
## Installation
[Available in Hex](https://hex.pm/packages/ecto_interval), the package can be installed
by adding `ecto_interval` to your list of dependencies in `mix.exs`:```elixir
{:ecto_interval, "~> 0.2.6"},
```## Usage
Just use `EctoInterval` as a field type, like:
```elixir
field :renewal_period, EctoInterval, default: %{months: 0, days: 0, secs: 0}
```## Contributors
- Special thanks to @ibarchenkov for updating to latest implementation!