Create Elixir functions with SQL as the body for database operations.
Defql is an Elixir library that enables developers to write database queries by defining functions where the body is SQL. It provides macros for common CRUD operations and raw SQL queries, simplifying database interactions in Elixir applications. It solves the problem of mixing SQL with Elixir code in a structured and maintainable way.
Elixir developers building applications that require direct SQL access or those looking for a lightweight alternative to full ORMs like Ecto's schema-based queries.
Developers choose Defql for its straightforward approach to embedding SQL in Elixir, reducing boilerplate while keeping queries explicit and adaptable. It offers more control than abstracted ORMs without sacrificing Elixir's functional patterns.
Create elixir functions with SQL as a body.
Enables defining Elixir functions with raw SQL using `defquery`, keeping queries explicit and maintainable, as shown in the README examples for custom queries.
Provides `defselect`, `definsert`, `defupdate`, and `defdelete` macros that reduce boilerplate for common operations, with optional table and column specifications.
Works with both Ecto repositories and standalone PostgreSQL connections via configurable adapters, offering integration flexibility without locking into a single approach.
Supports advanced SQL conditions like `:in`, `:like`, and `:ilike` directly in Elixir syntax, making query composition more intuitive, as listed in the README.
Primarily focused on PostgreSQL, with MySQL support listed as a TODO item, restricting use with other databases.
The TODO list includes adding transaction support, indicating it's not yet available, which could hinder data integrity in complex applications.
The TODO mentions 'Support database errors,' suggesting that error management might be basic or unstable, potentially complicating debugging.
The TODO includes 'Cleanup ECTO adapter,' implying possible integration issues or bugs when using Defql with Ecto.
A toolkit for data mapping and language integrated query.
PostgreSQL driver for Elixir
Event store using PostgreSQL for persistence
Fast, pipelined, resilient Redis driver for Elixir. 🛍
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.