talira

Data mapping and language-integrated queries for Elixir

open sourceApache-2.0free

Ecto is a toolkit for data mapping and language-integrated query in Elixir. Ecto.Schema maps data into Elixir structs, changesets cast and validate changes, Ecto.Query writes queries in Elixir with keyword or pipe syntax, and an Ecto.Repo runs them against a database through an adapter. ecto_sql adds the SQL adapters and database migrations, with drivers for PostgreSQL (postgrex), MySQL (myxql) and SQL Server (tds); community adapters cover SQLite, ClickHouse and ETS. It's also used to map and validate data that isn't in a database at all. New Phoenix projects include it with the PostgreSQL adapter by default, and Dashbit holds its copyright.

Problems it solves

  • query a Postgres database from my Elixir app
  • validate user input before saving it in Elixir
  • run database migrations in a Phoenix project

Features

  • schemas mapping data to Elixir structs
  • changesets for casting and validation
  • composable query DSL
  • repositories with database adapters
  • migrations through ecto_sql
  • PostgreSQL, MySQL and SQL Server adapters